HW7: Script my_compare Write a script called "my_compare" that compares two files, given by command line arguments. If the two files are different then the script prints out the message: These files are different: F1 F2 (where F1 and F2 are the names of the files) Otherwise it prints out the message: These files are identical: F1 F2 EXAMPLE: Suppose you had two identical files, x and y Then executing my_compare: my_compare x y would yield These files are identical: x y NOTES: Your script may make use of the Unix cmp utility. However, you will want to SUPPRESS the output of cmp. You may do that by redirecting its standard output to a special file called "/dev/null" (output that is directed there gets discarded automatically). Your script will need to discover the outcome of cmp. The exit status code of a program will be 0 if successful. In the case of cmp, "identical files" is synonymous with "success". So an exit status code of 0 means the files were identical-- any other exit status code means not-identical. The exit status code is symbolized in the shell by $?. So you will need to test $? and do one thing if it is 0 and another thing if it isn't. To do conditionals in the shell, the following syntax is used: if [ STRING1 = STRING2 ] ; then SOME COMMAND (May be more than one command) else SOME OTHER COMMAND (May be more than one command) fi Follow the above syntax EXACTLY, including placement of spaces! Words in capitals can be of your choosing. Here is an example: if [ $1 = DATE ] ; then date else who fi This checks the value of the first command-line argument. If it is equal to DATE then the date command is executed, otherwise the who command is executed. You should be able to apply this to your task here. MORE NOTES: a) Remember the first line of the script must be #! /bin/ksh b) Be sure to test your script with identical and non-identical files. (How can you make a pair of identical files?) c) The output of the script MUST be identical to that given in the specifications!!!!! SUBMITTING YOUR HOMEWORK: Use the toteach command to submit your script: toteach 7 my_compare