----------------------- Exercise #10 for CST8129 due November 16, 2005 ----------------------- -Ian! D. Allen - idallen@idallen.ca Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) Global weight: 1% of your total mark this term Due date: Before the end of your Lab period on Wednesday, November 16. The online deliverables for this exercise are to be submitted online via the T127 Linux Lab using the submit method described in the exercise description, below. No paper; no email; no FTP. Late-submission date: I will accept without penalty online exercises that are submitted late but before 12h00 (noon) on Friday, November 18. After that late-submission date, the exercise is worth zero marks. Exercises submitted by the *due date* will be marked online and your marks will be sent to you by email after the late-submission date. This exercise is due before the end of your Lab period on November 16. ------ Part I ------ Convert your three-integer sort code into a shell function named Sort3() that takes three input arguments and leaves the sorted result in shell variables $out1, $out2, and $out3. (Validate that exactly three numeric arguments are passed into the function; don't try to compare missing or non-numeric input arguments.) Modify your Exercise #6 integer sort script as follows: - copy your script to file exercise10script1.sh - validate the number and type of the command line input arguments (don't process missing or non-numeric command line arguments) - use your new Sort3() function to sort the three numbers Demonstrate your new integer sort script to your instructor. BONUS: +10% if the instructor is unable to break your script or function with bad or missing input data. ------- Part II ------- Copy your Exercise #8 script to file exercise10script2.sh Modify exercise10script2.sh to avoid numbers that are exactly plus or minus 10 of the middle number. (e.g. if the middle number is 30, the algorithm will not output numbers 20, 30, or 40.) Did this modification require re-coding or modifying your algorithm, or did you only need to change one constant value in your program? BONUS: +10% if your modifications did not require you to re-code your algorithm to handle the new values. Submission ---------- Submit the finished and labelled (with your Assignment Label at the top) files for marking using the following Linux command line: $ ~alleni/bin/copy10 exercise10script[12].sh The copy10 program will copy the selected files to me for marking. You can copy the files more than once. Only the most recent copies will be marked. This exercise is due at the end of your lab period today. P.S. Did you spell all the label fields and file names correctly?