In the post "Creating message box in a shell script" we saw how to create a message box using whiptail. Now let us see how to create a yes/no box where the user can choose one of the two and then the further action can be decided.
The syntax to create a yesno box using whiptail is
Example
If we select yes, the return value of the command will be 0, for no the return value will be 1. We can use the return value to decide the further course of action for the script.
Here is a script that keeps popping up the yes/no box as long as the user does not select "no" to stop the script.
$bash yesno.sh
The syntax to create a yesno box using whiptail is
Example
If we select yes, the return value of the command will be 0, for no the return value will be 1. We can use the return value to decide the further course of action for the script.
Here is a script that keeps popping up the yes/no box as long as the user does not select "no" to stop the script.
$bash yesno.sh
This post is already 10 years old, but it is exactly what I was looking for for a project with WHIMPTAIL. Thanks
ReplyDelete