% CST8207 Week 13 Notes -- shell scripts, regular expressions % Ian! D. Allen -- -- [www.idallen.com] % Fall 2015 - September to December 2015 - Updated 2016-04-04 11:01 EDT - [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 December 20.** - Feedback is anonymous. Professors are not told who said what. - I publish my [anonymous course evaluations], so your comments will be there to guide future students. - Dogbert on [satisfaction surveys] 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 Control Structures] -- if, then, else, test, `[...]`, `shift`, `while`, `do`, `done` 3. [Shell Script Problems] -- arithmetic, syntax, test, boolean, etc. 4. [Regular Expressions] -- matching patterns and replacing text 5. [Linux and Sysadmin News in the World] 6. [List of Commands You Should Know] -- keep a notebook! 7. [Video Tutorials on Lynda.com] -- tagged by week number ![Take Notes in Class] Assignments this week --------------------- When you are done your [course evaluation], create an empty file `.courseval_done` in your `Assignments` directory on the CLS and the nag messages in the checking program will go away. **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. - Read All The Words, Do, and then Submit via Blackboard: - Bonus (optional) [Assignment #04 HTML] -- the VIM text editor - Bonus (optional) [Assignment #09 HTML] -- Midterm #2 corrections - 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 #11 HTML] -- shell scripts - The checking program has a new feature to check just one of your scripts. - Really do **Read All The Words**. You don't get a second chance to get it right. - When you are done your [course evaluation], create an empty file `.courseval_done` in your `Assignments` directory on the CLS and the nag messages in the checking program will go away. Lab work this week ------------------ - [Assignment #11 HTML] -- shell scripts - The checking program has a new feature to check just one of your scripts. - Bonus (optional): Read [The VI (VIM) Text Editor] and optionally do the bonus [Assignment #04 HTML]. - Bonus (optional): Complete bonus [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 overwrite your question file with the output of the checking program.* Upcoming tests -------------- Read the [Test Instructions] (all the words) before all your tests and exams. - Final Exam: 8am to 11am (three hours) on December 19 in two rooms T117/T119 - Three Hours! Take a bathroom break before you start the exam. - The final exam emphasizes material after the second midterm test, but it covers the whole course and therefore includes material from **all** the practice question sets. - Take a bathroom break before you sit down for three hours! 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. - Bring your notes to class! Stop wasting time looking up commands. - See the Sysadmin news (above) about local NRCan Linux summer jobs. The `test` string equality operator is `=` not `==` --------------------------------------------------- [**Don't use double equals `==` in string tests**] in your scripts. Follow the link for details. Write Less Code --------------- [**Write Less Code**] Attacks on the Course Linux Server ---------------------------------- - Count the attacks: `fgrep -c "refused connect" /var/log/auth.log` - Another way to count the lines (less efficient): `fgrep "refused connect" /var/log/auth.log | wc` - See the current list of *evil* host IPs: `less /etc/hosts.evil` ![Read All The Words] -- | 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]: week13notes.txt [anonymous course evaluations]: /#coursenotes [satisfaction surveys]: http://dilbert.com/strips/comic/2005-04-07/ [Week 13 Notes HTML]: week13notes.html [Shell Control Structures]: 730_control_statements.html [Shell Script Problems]: 740_script_problems.html [Regular Expressions]: 800_regular_expressions.html [Linux and Sysadmin News in the World]: 950_linux_world.html [List of Commands You Should Know]: 900_unix_command_list.html [Video Tutorials on Lynda.com]: 910_lynda_index.html [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [course evaluation]: http://www.algonquincollege.com/studentfeedback/ [Assignment #04 HTML]: assignment04.html [Assignment #09 HTML]: assignment09.html [Assignment #11 HTML]: assignment11.html [The VI (VIM) Text Editor]: 300_vi_text_editor.html [Test Instructions]: 000_test_instructions.html [**Don't use double equals `==` in string tests**]: 740_script_problems.html#the-test-string-equality-operator-is-not [**Write Less Code**]: 750_script_style.html#less-code [Read All The Words]: ian_algonquin2014_read_all_the_words.jpg "Read All The Words" [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/