I am writing a bash script that prompts for for several user entries prior to the start of the script. I am looking for the best way to use dialog to have the users verify the information. I am trying to modify the example below:
#!/bin/bash # dynbox.sh - Yes/No box demo dialog --title "Delete file" \ --backtitle "Linux Shell Script Tutorial Example" \ --yesno "Are you sure you want to permanently delete \"/tmp/foo.txt\"?" 7 60 # Get exit status # 0 means user hit [yes] button. # 1 means user hit [no] button. # 255 means user hit [Esc] key. response=$? case $response in 0) echo "File deleted.";; 1) echo "File not deleted.";; 255) echo "[ESC] key pressed.";; esac
I am running it to some errors though when trying to create it. Basically I want a yes/no dialog box to say
Please verify your entered information: Install SSL : $InstallSSL Domain Name : $DomainName etc
the left side will be static text where the right will display the variable.
You can include newlines in a double quoted string which also expands variables:
dialog --title "Verification" \ --yesno "Please verify your entered information: Install SSL : $InstallSSL Domain Name : $DomainName" 7 60