Shell Scripts

    Part One Exercise (10 Marks)   Create an interactive script called divtest  that tests whether a user-specified number is divisible by two user-specified factors. The script will require that the two factors be specified by the user as integer command-line arguments. The script will prompt the user for the integer to test. To help clarify the requirements, consider the following example. Suppose 10 and 3 are the factors to be used in the test, and 21 is the integer to be tested. The user would run the command with the following command line, $ divtest 10 3 Then the script would prompt the user for the integer to test and the user would then provide the number 21 followed by pressing the <enter> key. Here is the way the script would run to completion (what the user would type is shown in bold): $ divtest  10 3Enter an integer to test: 2121 is divisible by 3.$ To give you a feel for the way the script should run under all conditions, here are 3 other sample runs (again, what the user would type is shown in bold): $ divtest 7 5Enter an integer to test: 7070 is divisible by 7.70 is divisible by 5.$ $ divtest 10 12Enter an integer to test: 3333 is not divisible by 10 or 12.$ $ divtest 10 12Enter an integer to test: 7070 is divisible by 10.$ Your script should also handle the situation where the user forgets to specify the factors on the command line as follows: $ divtestUsage error: two, integer command-line arguments required.Try again.     Exercise Two (10 marks) Create a script (that is not interactive) called drawBox  that outputs a box of characters with dimensions specified by the user on the command line. When the user runs the command she/he would provide 4 command-line arguments as follows: • The first argument is an integer specifying the width of the box to be drawn.• The second argument is an integer specifying the height of the box to be drawn.• The third argument is a letter that is used to fill the odd numbered lines.• The fourth argument is a letter that is used to fill the even numbered lines.The sample runs below demonstrate how your script should run (what the user would type is shown in bold): $ drawBoxError: Invalid number of arguments  - Enter 4 arguments on the command line.  - enter 2 integers followed by two letters.$ drawBox 6 3 X O XXXXXXOOOOOOXXXXXX $ drawBox 6 3 O X OOOOOOXXXXXXOOOOOO $ drawBox 20 7 O X OOOOOOOOOOOOOOOOOOOOXXXXXXXXXXXXXXXXXXXXOOOOOOOOOOOOOOOOOOOOXXXXXXXXXXXXXXXXXXXXOOOOOOOOOOOOOOOOOOOOXXXXXXXXXXXXXXXXXXXXOOOOOOOOOOOOOOOOOOOO $ drawBox 10 1 O X OOOOOOOOOO $ drawBox 10 8 V M VVVVVVVVVVMMMMMMMMMMVVVVVVVVVVMMMMMMMMMMVVVVVVVVVVMMMMMMMMMMVVVVVVVVVVMMMMMMMMMM $ drawBox 20 9 o w oooooooooooooooooooowwwwwwwwwwwwwwwwwwwwoooooooooooooooooooowwwwwwwwwwwwwwwwwwwwoooooooooooooooooooowwwwwwwwwwwwwwwwwwwwoooooooooooooooooooowwwwwwwwwwwwwwwwwwwwoooooooooooooooooooo $