% CST8207 Week 12 Notes -- Shell Scripts: control structures, problems % Ian! D. Allen -- -- [www.idallen.com] % Winter 2016 - January to April 2016 - Updated 2016-04-06 12:04 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 May 1.** - 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. - Listen to Dogbert on [satisfaction surveys] Readings, Assignments, Labs, Tests, and ToDo ============================================ Read (at least) these things (All The Words) -------------------------------------------- 1. [Week 12 Notes HTML] -- this file -- **Read All The Words** 2. [Shell Control Structures -- if, then, else, test, `[...]`][1] 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 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 #11 HTML] -- shell scripts - The checking program has a 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. 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 #11 HTML] -- shell scripts - The checking program has a feature to check just one of your scripts. 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. [Microsoft supports Linux command-line programs on Windows 10][Linux and Sysadmin News in the World] Finding world-writable files in your account -------------------------------------------- Don't create files or directories that anyone ("other") can write, except the required ones in the [Assignment #08 HTML] `head` directory! - To learn how to `find` these world-writable files in your account, look for the text `world-writable` in all the course notes. - To search the course notes, re-read Items 7 and 8 in section 4.4 of [Assignment #05 HTML]. See also the examples in the web notes on finding files in the [Week 03 Notes HTML]. - You will be able to identify which course notes web page you should read to find out how to find world-writable files. The `test` string equality operator is `=` not `==` --------------------------------------------------- [**Don't use double equals `==` in string tests**] in your scripts. Follow the link for details. 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]: week12notes.txt [anonymous course evaluations]: /#coursenotes [satisfaction surveys]: http://dilbert.com/strips/comic/2005-04-07/ [Week 12 Notes HTML]: week12notes.html [1]: 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 #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 [Practice Tests and Answers]: PRACTICE_TEST_README.html [Assignment #08 HTML]: assignment08.html [Assignment #05 HTML]: assignment05.html [Week 03 Notes HTML]: week03notes.html [**Don't use double equals `==` in string tests**]: 740_script_problems.html#the-test-string-equality-operator-is-not [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/