% CST8207 Week 11 Notes -- Shell Scripts: command substitution, exit status, control structures % Ian! D. Allen -- -- [www.idallen.com] % Winter 2016 - January to April 2016 - Updated 2016-04-04 10:39 EDT - [Course Home Page] - [Course Outline] - [All Weeks] - [Plain Text] Readings, Assignments, Labs, Tests, and ToDo ============================================ Read (at least) these things (All The Words) -------------------------------------------- 1. [Week 11 Notes HTML] -- this file -- **Read All The Words** 2. [Shell command substituion -- interpolate stdout into a command line using $(...) or \`...\`] 3. [Command exit status -- variable $?] 4. [Shell Control Structures -- if, then, else, test, `[...]`][1] 5. [List of Commands You Should Know] 6. [Linux and Sysadmin News in the World] 7. [Video Tutorials on Lynda.com] -- tagged by week number Assignments this week --------------------- > **Reminder:** There are now two quizzes that you need to complete on > Blackboard as part of your term Quiz mark. A third quiz will be posted > before the Final Exam. The Quizzes are *not* optional. Check the due date for each assignment and put a reminder in your agenda, calendar, and digital assistant. Just like in the Real World, not all due dates are on the same days or at the same times. - Read All The Words, Do, and then Submit via Blackboard: - Bonus (optional) [Assignment #04 HTML] -- the VIM text editor - Bonus (optional) [Assignment #09 HTML] about Midterm #2 - There is a checking program available to check your file format for this bonus assignment, but only people who Read All These Words will know about it. Wrong format means no marks. - [Assignment #10 HTML] -- tar, processes, syslog, crontab, at, mail, shell script - Really do **Read All The Words**. You don't get a second chance to get it right. Lab work this week ------------------ - Read [The VI (VIM) Text Editor] and optionally do the bonus [Assignment #04 HTML]. - Bonus (optional) [Assignment #09 HTML] about Midterm #2 - There is a checking program available to check your file format for this bonus assignment, but only people who Read All These Words will know about it. Wrong format means no marks. - [Assignment #10 HTML] -- tar, processes, syslog, crontab, at, mail, shell script Final Exam 8am C144 Wednesday April 27 -------------------------------------- The **Final Exam** is 8am to 11am (three hours) in C144 Wednesday April 27 in Week 15. Put the 8am exam date and time into your phone reminders! - Read the [Test Instructions] (all the words) before your exam. - The final exam emphasizes material after the second midterm test, but it covers the whole course and therefore includes material from **all** the assignments and [Practice Tests and Answers]. - Three Hours! Take a bathroom break before you start the exam. From the Class Notes link on the Course Home Page ================================================= - [Course Home Page] - [All Weeks] - Review last week. Did you do everything assigned last week? From the Classroom Whiteboard/Chalkboard ======================================== - **Take notes in class!** Your in-class notes would go here. Fifteen minute rule ------------------- Your time as a student is valuable. See the [Week 03 Notes HTML]. Commands -------- Keep a notebook with a [List of Commands][List of Commands You Should Know] in it. - You need to write down yourself what each command *does*. - I will check for this list in your lab periods. - Check the updated list of commands each week. Locked out ---------- The CLS will lock out your IP address if you can't type your own userid correctly. If this happens, you have to follow the posted directions to have me unlock your IP address. You can change to another IP address. You can always come to school where no IP addresses are locked out. Attacks on the Course Linux Server ---------------------------------- - Count the attacks: `fgrep -c "refused connect" /var/log/auth.log` - Another way to count the attack lines (slightly less efficient): `fgrep "refused connect" /var/log/auth.log | wc` - See the current list of *evil* host IPs: `less /etc/hosts.evil` ![Take Notes in Class] -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown] format [www.idallen.com]: http://www.idallen.com/ [Course Home Page]: .. [Course Outline]: course_outline.pdf [All Weeks]: indexcgi.cgi [Plain Text]: week11notes.txt [Week 11 Notes HTML]: week11notes.html [Shell command substituion -- interpolate stdout into a command line using $(...) or \`...\`]: 710_command_substitution.html [Command exit status -- variable $?]: 720_exit_status.html [1]: 730_control_statements.html [List of Commands You Should Know]: 900_unix_command_list.html [Linux and Sysadmin News in the World]: 950_linux_world.html [Video Tutorials on Lynda.com]: 910_lynda_index.html [Assignment #04 HTML]: assignment04.html [Assignment #09 HTML]: assignment09.html [Assignment #10 HTML]: assignment10.html [The VI (VIM) Text Editor]: 300_vi_text_editor.html [Test Instructions]: 000_test_instructions.html [Practice Tests and Answers]: PRACTICE_TEST_README.html [Week 03 Notes HTML]: week03notes.html [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/