
Interact graphically in bash script
xmessage
Most *nix computers are equipped with xmessage Software, it can recover the choices made by the user graphically. The following code will display a dialog box with two buttons and a little text.xmessage -buttons Yes,No -center "Are you sure you want to do that?"
echo $?
In fact the first button returns 101, the second 102...
Use this return code as you wish.