Question: Write a BASH script that performs the following operations: Prompts the user to enter the number of searches they want to perform (N) Run
Write a BASH script that performs the following operations: Prompts the user to enter the number of searches they want to perform (N) Run a loop N times, each iteration should do the following Ask the user to enter a mode (1 or 2) If the user enters 1, search for filename as follows Prompt the user for the name of the file they wish to search for Prompt the user for the directory the want to start the search in . Search for the user specified file in the user specified directory, outputting the results to the screen If the user enters 2, search for files based on user who owns file Prompt the user for the name of the user they wish to find files owned by Prompt the user for the directory they want to start the search in Search for files owned by the specified owner in the specified directory, outputting the results to the screen. End loop after N iterations. Write a script that prompts the user to enter the name of a file they wish to perform an action on. Following this, provide the user with a menu comprising two options. Option 1 is to show the file permissions of the file while Option 2 is to delete the file. Ask the user to enter 'p' to choose option 1 or 'd' to choose option 2. After the user has entered their option, perform the action required for that option (i.e. show file permissions or delete the file)
Step by Step Solution
3.45 Rating (164 Votes )
There are 3 Steps involved in it
binbash Prompt the user to enter the number of searches they want to perform N echo How many searche... View full answer
Get step-by-step solutions from verified subject matter experts
