Question: Write a shell script (in Linux) that displays the following menu items, prompts the user to enter a selection, and then executes the command associated
Write a shell script (in Linux) that displays the following menu items, prompts the user to enter a selection, and then executes the command associated
with that menu item. If required, prompt the user for additional commands should the menu item require it.
The menu items:
(a) Display a list of files and directories in the current directory
(b) Display a long list of the contents of the current directory
(c) Display a list of the last n messages in /var/log/messages, prompting for the value of n
(d) Display the contents of this script
(e) Display the contents of this script in reverse
(f) Exit the script
Dont forget to have the script keep running until the user selects the exit option.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
