script3.sh: Write a shell script which asks the user to enter two numbers, the first one a being smaller than the second number, if the first number entered is bigger than the second, print off the...


script3.sh: Write a shell script which asks the user to enter two numbers, the first one a being smaller than the second number, if the first number entered is bigger than the second, print off the message "The first number must be smaller than the second!" and stop the script, if the first number is smaller than the second, have the script list all ordinary files with sizes between a certain range in a given directory. Assume that the directory is specified when the script is run as the first and only command line argument. Display only the files between the minimum size (in number of bytes) and the maximum size (in number of bytes) that the user entered in (minimum size is the first number, and maximum size is the second number). Thus, your script must output under the directory (specified by the first argument $l) all the files whose sizes are no less than the minimum size (the smaller number) and no greater than the maximum size (the bigger number) in bytes. Each file's name must be displayed along with its size on one line. Only consider files in the directory given, not in any subdirectories. See the example below to see how to have your program display information. As an example, suppose in the directory/opt/new/there are four ordinary files: a.txt, b.txt, c.txt and d.txt, and their sizes are 3, 9, 14 and 20 bytes, respectively. If you run your script using the command ./script3.sh/opt/new/, and you enter in the values 5 and 15 when asked, you should get the exact same following output: Enter a number: 5 Enter in a bigger number: 15 The files in/opt/new/that are between 5 and 15 bytes are the following: b.txt is 9 bytes c.txt is 14 bytes


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here