------------------------ Week 9 Notes for CST8129 ------------------------ -Ian! D. Allen - idallen@idallen.ca *** Keep up on your readings (Course Outline: average 5 hours/week homework) Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) -------------------- Review of last week: -------------------- shell_variables.txt Shell Variables you should know (including $* and $@) command_substitution.txt Command Substitution - $(unix command) unix_shell.txt The Unix/Linux Shell (review $PATH in this file) quick_tests.txt Return Code, Exit Status, ||, &&, test, and if less_code.txt Less Code is Better Code - stop cutting and pasting deep_nesting.txt Avoiding deeply nested IF statements - always double-quote your variables and command substitutions! - without double-quotes, the shell will re-expand the variable contents! ---------- This week: ---------- File and directory permissions: permissions.txt Unix Permissions umask.txt Umask and Permissions Review: chmod New: umask - like most things, umask is inherited by children - parent process unaffected by changes made by children Shell Variables: Quigley: Chapter 2 (Bourne Shell and KSH only - no CSH or TCSH) shell_variables.txt Shell Variables you should know (including $* and $@) New: export, source New: PATH, whereis, which New: LC_COLLATE, LANG - like most things, exported variables are inherited by children - parent process unaffected by changes made by children PATH=/bin ; ./foo ; echo "$PATH" # no change to $PATH Summary of shell script coding requirements: script_style.txt Shell Script Programming Conventions and Style script_checklist.txt Shell Script Checklist - things to verify - error messages must contain 4 things Shell Input (reading from the user): shell_read.txt Reading stdin into shell variables - read, EOF, and exec Background info on scripting: character_sets.txt Collate Order and Character Set shell_script_execution.txt How a Shell Script is "Executed" links_and_inodes.html Hard links and Unix file system nodes (inodes) Examples and Practice practiceTest2script.txt Practice Script #1 Specifications practiceTest2script.sh.txt Sample solution to practiceTest2script.txt practiceCommands_2.txt Practice Unix/Linux Questions #2 practiceCommands_3.txt Practice Unix/Linux Questions #3 Sample shell scripts * See the "Shell Scripts" section of the Course Notes for many * sample shell scripts that demonstrate programming features. Shell Shortcuts (useful but optional) job_control.txt Shell background/foreground job control finding_files.txt Searching for and finding files by name ---------- Next Week: ---------- Online Midterm Test Wednesday