How do I prompt for Yes/No/Cancel input in a Linux shell script?

后端 未结 30 1717
不思量自难忘°
不思量自难忘° 2020-11-22 04:52

I want to pause input in a shell script, and prompt the user for choices.
The standard Yes, No, or Cancel type question.
How d

30条回答
  •  鱼传尺愫
    2020-11-22 05:07

    I suggest you use dialog...

    Linux Apprentice: Improve Bash Shell Scripts Using Dialog

    The dialog command enables the use of window boxes in shell scripts to make their use more interactive.

    it's simple and easy to use, there's also a gnome version called gdialog that takes the exact same parameters, but shows it GUI style on X.

提交回复
热议问题