------------------------ Week 9 Notes for DAT2330 ------------------------ -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) ------ Review ------ In Week 8 (week08notes.txt) you learned about sending error messages to standard error, about shell variables and about Command Substitution. You wrote a practice script in the Lab (similar to the type of script you will write on the Unix final exam) and you submitted it at the end of your lab period. You learned new operators for the "test" command, and how to "negate" or invert the test (all in file exit_status.txt). You learned about Input Redirection. You now know some basic meaning and usage of these Unix/Linux commands: bash passwd pwd cd mkdir rmdir rm ls vim cat more less man echo cp stty du wc date chmod who mesg mv head tail touch sort grep file diff sleep which whereis ^Z fg bg kill ln tar ssh scp ftp umask if/else/elsif/fi while/do/done for/in/do/done gzip gunzip bzip2 bunzip2 zcat zless zgrep gcc g++ read ------------------ This Week (Week 9) ------------------ In-Lab Exercise: Ask your questions in the lab this week in preparation for the final exam next Monday. You can also post to the Discussion News group. 1. Readings in Running Linux: Nothing new this week - make sure you have read all the sections from previous weeks. 2. Read these updated files under the Notes button on the course home page: shell_read.txt - Reading stdin into shell variables shell_variables.txt - Shell Variables you should know (including $* and $@) practiceTest2.txt - ASCII text version of Practice Test #2 practiceTest2.pdf - PDF version of Practice Test #2 practiceTest2.ps - Postscript text version of Practice Test #2 dat2330_03f_course_outline.pdf - the Course Outline (finally!) 3. Finish DAT2330 Exercise #8. Submit it by the due date. 4. Study for the Unix Final Exam 4pm-6pm Monday October 27. Important Notes: - Read the weekly notes (including the ones you've been avoiding from last week) and do the readings before you attempt to finish Exercise #8. - DOUBLE QUOTE ALL VARIABLES to protect contents from unwanted shell GLOBbing. Double quotes permit the shell to expand the variables; but, they stop GLOB metacharacters from being expanded. - All quoted strings are always part of one single argument, except for the one "$@" special case (see shell_variables.txt for details). - Use variables to hold constants (like you use #define in C) - reduce maintenance: how many edits needed to change a constant? - Review the use of Command Substitution (see last week's notes).