Questions tagged [whiptail]

Whiptail is a tool used for displaying dialog boxes to users.

Whiptail is commonly used to display data in the form of data boxes. Some of the most common dialog boxes include

Info Box: (A data box displaying text)

whiptail --infobox "This is an infobox"

Message Box: (Waits for the user to click the OK button)

whiptail --msgbox "This is a message box"

Yes/No Box: (Offers users a choice of yes or no)

whiptail --yesno "Do you like dogs?"

Input Box: (Allows for user input)

whiptail --inputbox "Tell us your thoughts"

Password Box: (Masks user input)

whiptail --passwordbox "Enter a password"

Menu: (Present users with a list of options)

whiptail --menu "Choose an option [Dialog Height] [Dialog Width] [Menu Height] \ Apple A red fruit \ Pineaaple A tropical fruit \ Watermelon A Summer Fruit"

For more information please visit

https://en.wikibooks.org/wiki/Bash_Shell_Scripting/Whiptail

68 questions
1
vote
2 answers

Bash incantation for defining whiptail radiolist programmatically

I want to issue a bash command similar to this: whiptail --title 'Select Database' --radiolist 'Select Database:' 10 80 2 \ 1 production off \ 2 localhost on Whiptail is rather particular about how the radio list values are specified. They…
Mike Slinn
  • 7,705
  • 5
  • 51
  • 85
1
vote
1 answer

Feed python output to whiptail

I would like to use a TUI (text user interface) on a headless linux server by passing output of some PYTHON code to 'whiptail'. Unfortunately, nothing seems to happen in whiptail. When I pipe the output from a regular shell script, then whiptail…
G.A.
  • 1,443
  • 2
  • 22
  • 34
1
vote
2 answers

local variable changes whiptail behaviour

I have this script: #!/bin/bash menu() { while true; do opt=$(whiptail \ --title "Select an item" \ --menu "" 20 70 10 \ "1 :" "Apple" \ "2 :" "Banana" \ "3 :" "Cherry" \ "4 :" "Pear" \ …
SBF
  • 1,252
  • 3
  • 12
  • 21
1
vote
1 answer

How to return value from Whiptail --yesno

I'm creating a shell script to run on my raspberry pi. Along the way I'm trying to simplify some repeated code and I'd like to make a wrapper for the whiptail function like below. function yesno() { answer=$(whiptail --yesno "$1" 0 0 3>&1 1>&2…
Jens Ackou
  • 151
  • 11
1
vote
1 answer

whiptail - window resize

I'm using whiptail for a menu based tool. I'm able to set the display for the current window on start with : window=$(stty -a | tr \; \\012 |egrep 'rows|columns' | cut '-d ' -f3) whiptail --title "Multinode Main Menu" --menu "\n\n\n\n\n\n\n\n"…
zlobul
  • 335
  • 1
  • 5
  • 20
1
vote
1 answer

Using script to remotely execute whiptail script

I am trying to execute a bash script that contains whiptail remotely through ssh. The problem is that ssh won't show any of the whiptail UI. What would be the best way to display the whiptail prompts on a local computer? The script is an…
1
vote
1 answer

bash - getting a number from a stream

The typical output recorded into chk file from the command: wget -O - http://website/file > /dev/null 2>chk & is something like : 0K .......... .......... .......... .......... .......... 0% 143K 62s 50K .......... .......... ..........…
MAXIM
  • 33
  • 4
1
vote
1 answer

Bash - find string associated with number?

So, my script is supposed to prompt the user which file to select using whiptail, then read some things from the user selected file. Whiptail takes 2 arguments: The number of the list entry, and the list entry itself. When the user selects a list…
Lightn1ng
  • 27
  • 4
1
vote
2 answers

Whiptail inputbox cancel not working

I've created a loop to go through some Virtual Machine setup functions for a new user, which goes through things like adding a hostname, ip address, etc. However, if I click the 'Cancel' button within any of the whiptail windows, it just moves on…
Godzilla74
  • 2,358
  • 1
  • 31
  • 67
1
vote
1 answer

Override whiplash exitstatus from msgbox

Is it possible to override the exitstatus from a whiptail msgbox ? By default, hitting the OK button exists the whiptail application. Ideally, I'd like to end up back on my main menu page, since that is the focal point of my app: #!…
Godzilla74
  • 2,358
  • 1
  • 31
  • 67
1
vote
1 answer

How could I parse an output command with shell scripting?

I'm working on a shell script that is an interface for Git using Whiptail (shell interface). There is my problem, I would like to create a menu where we could select the branch of a Git repository and return this string to the script. I know how to…
Liroo Pierre
  • 875
  • 2
  • 9
  • 25
1
vote
1 answer

How to quote variables in a whiptail command with dynamic/conditional options?

I need to disable options in a dialog command built in a Bash script. Here is the original working script: my_backtitle="This is a test" selected_options=($(dialog \ --backtitle "$my_backtitle" \ --separate-output \ --checklist "Select…
pedroapero
  • 1,228
  • 10
  • 14
1
vote
1 answer

display a variable with whiptail

I want to display the value of a real-time variable in a whiptail interface. I my incremented variable like that = #!/bin/bash i=1 while test $i -ne 51 do echo "$i" i=$(($i + 1)) #icremente i done how I can display the real-time…
alex_
  • 21
  • 3
1
vote
2 answers

Whiptail or dialog don't working by ssh

I have Ubuntu 12.04 Server at virtual machine and installed OpenSSH server on it. I have simple script with whiptail #!/bin/sh whiptail --title "Example dialog" --infobox "TTTTTT" 8 78 On server this script is working and i seen the infobox. But in…
user2896129
  • 13
  • 1
  • 3
1
vote
1 answer

Whiptail --infobox in Debian does not work

Someone working this code in Debian ? whiptail --infobox "test" 0 0 Can you please try? My code does not work :-( How to fix the solution? whiptail --msgbox "test" 0 0 # works fine Thank you..