If we need to obtain a yes or no answer from the user, we can use the following options along with the dialog command:
$ dialog --yesno "Would you like to continue?" 10 50
We can have the same yes/no dialog box with a title as follows:
$ dialog --title "yesno box" --yesno "Would you like to continue?" 10 50
Let's write the dialog_01.sh shell script as follows:
#!/bin/bash dialog --title "Delete file" --backtitle "Learning Dialog Yes-No box" --yesno "Do you want to delete file "~/work/sample.txt"?" 7 60 # Selecting "Yes" ...