Usually, a program or shell script may be required to perform multiple types of tasks. In such cases, the menu box option is very useful. This option will display a list of choices for the user. Then, the user may select an option of their own choice. Our script should execute the desired option.
Each menu has two fields, a tag and an item string. In the next example menu demo, we have tags such as date, calendar, and editor. A description of a tag is called an item string.
Let's write the dialog_04.sh shell script to create a menu as follows:
#!/bin/bash # Declare file to store selected menu option RESPONSE=menu.txt # Declare file to store content to display date and cal output TEMP_DATA=output.txt vi_editor=vi # trap ...