LAB ASSIGNMENT Write a shel script to search through a list of directories and i
ID: 3733296 • Letter: L
Question
LAB ASSIGNMENT Write a shel script to search through a list of directories and interactively find space to recover Space could be recovered in several ways, but only with the user's confirmation for file removal squeeze [-s size] [-d days] [directory 1 ...1 The script is actually 2 scripts. The top level script is called squeeze and uses find to invoke the lower level script which should be named squeeze file The size and days options should be set using getopts inside squeeze. If size is omitted it should be set to 1000000. If days is omitted it should be set to 10. If there are no directories use the current directory. These options should be used with find to locate files which are either that size or larger or else modified at a time older than days number of days or named core or a.out The squeeze file scriptwl be called with the name of 1 file which is either old or large or both. Inside squeeze file you should present the file to the user in a while true loop to allow the user to decide what to do. The user can use commands 1, m, o, r, g, or c to indicate "s -1" "more", "od-x", "mn”, ”gzip" or "continue". Commands I, m and o perform an action without exiting the loop. Commands r, g and c perform an action and exit the loop. Actually c simply exits the loop Command r should only be done after confirming through prompting and reading a y, with either lower case or upper case with possibly more letters following the yExplanation / Answer
I have written the following code to search all the file names in the current working directory that contain the letter 'f'.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.