% CST8207 Week 13 Notes -- Shell Scripts, writing and debugging % Ian! D. Allen -- -- [www.idallen.com] % Winter 2017 - January to April 2017 - Updated 2018-01-06 02:14 EST - [Course Home Page] - [Course Outline] - [All Weeks] - [Plain Text] C O U R S E    E V A L U A T I O N ================================== ____ _ ____ __ __ | _ \ | | ___ __ _ ___ ___ | _ \ ___ \ \ / /___ _ _ _ __ | |_) || | / _ \ / _` |/ __| / _ \ | | | | / _ \ \ V // _ \ | | | || '__| | __/ | || __/| (_| |\__ \| __/ | |_| || (_) | | || (_) || |_| || | |_| |_| \___| \__,_||___/ \___| |____/ \___/ |_| \___/ \__,_||_| ____ ____ _____ _____ _ _ _ / ___/ ___|_ _| | ____|_ ____ _| |_ _ __ _| |_(_) ___ _ __ | | \___ \ | | | _| \ \ / / _` | | | | |/ _` | __| |/ _ \| '_ \ | |___ ___) || | | |___ \ V / (_| | | |_| | (_| | |_| | (_) | | | | \____|____/ |_| |_____| \_/ \__,_|_|\__,_|\__,_|\__|_|\___/|_| |_| -    **Closes Sunday April 30.** - Feedback is anonymous. Professors are not told who said what and results are not released until after grades have been submitted. - I publish my [anonymous course evaluations], so your comments will be there to guide future students. - Listen to Dogbert on [satisfaction surveys] - The Checking Program for your assignments tells you how to turn off the nag message. Read All The Words. Readings, Assignments, Labs, Tests, and ToDo ============================================ Read (at least) these things (All The Words) -------------------------------------------- 1. [Week 13 Notes HTML] -- this file -- **Read All The Words** 2. [Shell Script Control Structures] -- if, then, else, test, `[...]` 3. [Shell Script Problems] -- arithmetic, syntax, test, boolean, etc. 4. [List of Commands You Should Know] 5. [Linux and Sysadmin News in the World] 6. [Video Tutorials on Lynda.com] -- tagged by week number Assignments, Quizzes, and Lab work 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; see the [Course > Outline]. 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. - Review last week. Did you do everything assigned last week? - Do 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. *Do not redirect or submit the output of this checking program!* - [Assignment #10 HTML] -- tar, processes, syslog, crontab, at, mail, shell script - Do [Assignment #11 HTML] -- simple shell scripts - The checking program has a feature to check just one of your scripts. - Look for the upcoming [Assignment #12 HTML] -- more shell scripts - Practice test #3 is posted under [Practice Tests and Answers]. The Final Exam is comprehensive of the whole course; you need to do all *three* practice tests for the Final Exam. Upcoming tests and exams ------------------------ This course has two midterm tests and one final exam. - Put these dates below into your phone! - Read the [Test Instructions] (all the words) before your tests and exam. - Use the **Name Game** link (in the [Test Instructions]) to test the spelling of your name before the test. - I don't answer questions about the instructions during the test. Ask me in a lab period before the test. ### The Final Exam -- 8am Friday April 28 -- 40% The Final Exam is three hours long and contains approximately 180 multiple-choice questions similar to those found in the three preceding [Practice Tests and Answers]. Do *all three* practice tests before the Final Exam! - Time: 08h00-11h00 (8am to 11am) Friday April 28 (Week 15) - Location: CA-105 A,B,C (across the Woodroffe pedestrian overpass) - This exam has **assigned seating** -- see your email for your assigned seat. - 180 minutes (three hours) for 180 questions - Do *all three* practice tests before the Final Exam! - Three Hours! Take a bathroom break before you start the exam! All three practice tests are posted under [Practice Tests and Answers]. The Final Exam is comprehensive of the whole course; you need to do *all three* practice tests for the Final Exam. Notes from the Classroom ======================== - **Take notes in class!** Keep a pad open on your desk. - Don't forget to finish your five Blackboard quiz attempts for each of Midterm 1, Midterm 2, and the Final Exam. Quizzes count toward your final grade. - All three practice tests are now available. We have not yet covered all the material needed to do all the questions on the third practice test. - Your VIM and NANO wall of shame: - Fan mail: From: King, Alexander J To: Ian Allen Subject: Lecture cap inquiry Date: Sat, 8 Apr 2017 05:22:52 -0400 Professor Allen, My name is Alexander King and I'm a computer science engineering student at The University of Toledo, Ohio. I came across a video of you rapping the other day. I must say it was entertaining. After that I went on to find your website . I'm writing to inquire if any of your lectures have been recorded and if you're able and willing to share them with me? Your is amazing as it is but I figured I would ask if actual lectures were out there somewhere. All the best, Alexander J King - Understanding matching a non-digit. You need to understand [`case` Statements] and [Shell Glob Patterns]. 1. Match a digit "0" anywhere in the argument: case "$1" in *0* ) do something here ... ;; esac 2. Match digits "0" or "1" anywhere in the argument: case "$1" in *[01]* ) do something here ... ;; esac 3. Match digits "0" through "9" anywhere in the argument: case "$1" in *[0-9]* ) do something here ... ;; esac 4. Match digits "0" through "9" anywhere in the argument using a POSIX character class named '[:digit:]' that replaces range '0-9': case "$1" in *[[:digit:]]* ) do something here ... ;; esac 5. Match any character that is *NOT* a digit: case "$1" in *[![:digit:]]* ) do something here ... ;; esac | Other useful POSIX classes: `[:digit:] [:alpha:] [:alnum:] [:space:]` | See [POSIX Character Classes] Commands Used ------------- - 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. - Bring your notes to class! Stop wasting time looking up commands. - I am still seeing people unable to find command names referenced in assignments, e.g. the *kernel ring buffer* command. If you do not have an up-to-date list of commands and what they do, you are wasting your time! Fifteen minute rule: don't waste your time ========================================== See the [Course Introduction: fifteen minute rule] ![Take Notes in Class] -- | Ian! D. Allen, BA, MMath - 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]: week13notes.txt [anonymous course evaluations]: /#coursenotes [satisfaction surveys]: http://dilbert.com/strips/comic/2005-04-07/ [Week 13 Notes HTML]: week13notes.html [Shell Script Control Structures]: 730_control_statements.html [Shell Script Problems]: 740_script_problems.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 #09 HTML]: assignment09.html [Assignment #10 HTML]: assignment10.html [Assignment #11 HTML]: assignment11.html [Assignment #12 HTML]: assignment12.html [Practice Tests and Answers]: PRACTICE_TEST_README.html [Test Instructions]: 000_test_instructions.html [`case` Statements]: 730_control_statements.html#the-multi-way-case-esac-statement-with-glob-patterns [Shell Glob Patterns]: 190_glob_patterns.html [POSIX Character Classes]: https://en.wikipedia.org/wiki/Regular_expression#Character_classes [Course Introduction: fifteen minute rule]: 050_course_introduction.html#fifteen-minute-rule-dont-waste-your-time [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/