Created
May 20, 2020 12:40
-
-
Save elkoniu/1aa4272bfb4854bb8ed8124d00d8c031 to your computer and use it in GitHub Desktop.
Prompt example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment