Question: Write a bash script that performs the following steps: Prompt the user for a directory name, verify that the directory exists, and navigate into that

Write a bash script that performs the following steps:
Prompt the user for a directory name, verify that the directory exists, and navigate into that directory. If the directory does not exist, allow the user to create it
List all the files and subdirectories in the directory and display a menu to the user to select a file or a subdirectory.
If a file is selected:
3a. Display the first ten lines of the file.
3b. Ask the user if they want to display more. If "yes", display the next ten lines.
3c. Continue this process until the user responds with "no" or the end of the file is reached.
4.If a subdirectory is selected:
4a. navigate into that subdirectory.
4b. Perform a recursive search to find all files that have been modified in the last 24 hours.
4c. Present a list of these files to the user and ask them to select one.
4d. For the selected file, repeat the file display process as described in step 3.
After the operation is completed for either a file or subdirectory, return to the main menu to allow the user to select another file or subdirectory, or to exit the script.
 Write a bash script that performs the following steps: Prompt the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!