2019.09.24.student.pdf - Announcements ‣ out-of-class midterm exam •17:30(5:30 p.m – 19:00(7:00 p.m on Monday •HLTH E1150 •closed-book

2019.09.24.student.pdf - Announcements ‣ out-of-class...

This preview shows page 1 - 15 out of 62 pages.

Announcements out-of-class midterm exam •17:30 (5:30 p.m.) – 19:00 (7:00 p.m.) on Monday, October 28, 2019 •HLTH E1150 •closed-book, multiple choice exam - answers recorded on mark-sense forms 1
Image of page 1
Announcements Computer Science Department looking for volunteers for Open House •Open House sessions are on Friday, September 27, 11:30 - 12:20 and 13:30 - 14:20 •need basic Python skills •contact [email protected] 2
Image of page 2
Announcements Functional Programming YXE •Hosted by Chris Penner (Cmpt 214 survivor) •Tuesday, September 24 •18:00 - 21:00 •7Shifts 200 - 701 Broadway Avenue •more information at 3
Image of page 3
Announcements Scotia on Campus •Targeting 1st - 3rd year students interested in summer opportunities •Thursday, September 26 •15:30 - 17:00 •University Club 4
Image of page 4
Quote of the Day Unix gives you just enough rope to hang yourself -- and then a couple of more feet, just to be sure. •Eric Allman UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity. •Dennis Ritchie 5
Image of page 5
Picking up from last day … 6
Image of page 6
Preventing Shell Interpretation Occasionally want to prevent shell from interpreting those characters; e.g. character | being given as argument to cut •a file name with a special characters in it 7 bash-5.0$ cut -f 3 -d | data bash: data: command not found cut: option requires an argument -- 'd' Try 'cut --help' for more information. bash-5.0$ ls -l t&t order.pdf [1] 41208 bash: t: command not found bash-5.0$ ls: cannot access 't': No such file or directory
Image of page 7
Escape Character can prevent interpretation of a character by preceding it by the escape character, \ •bash-5.0$ cut -f 3 -d \| data •bash-5.0$ ls -l t\&t\ order.pdf 8
Image of page 8
Quote Character can prevent some interpretation of a string by enclosing it in double quotes, " •certain kinds of shell interpretation, such as variable expansion, will still be performed; e.g. bash-5.0$ ls -l "$HOME/t&t order.pdf" 9 bash-5.0$ cut -f 3 -d "|" data bash-5.0$ ls -l "t&t order.pdf"
Image of page 9
Quote Character to prevent most interpretation of a string by the shell, enclose it in (forward) single quotes, ' e.g. bash-5.0$ echo '$HOME &' $HOME & versus bash-5.0$ echo "$HOME &" /faculty/kusalik & N.B.: do not use back single quote, ` means something completely different 10
Image of page 10
UNIX Shell 11 Compound Shell Commands Preventing Shell Interpretation Regular Expressions
Image of page 11
Regular Expressions define text patterns, usually within a single line •pattern matching •pattern generation normal characters special metacharacters similar to, but distinct from , filename patterns in the shell •a different syntax •more powerful/general typically match first occurrence 12
Image of page 12
13 grep derivation: g/re/p for “g lobal / r egular e xpression / p rint” one of the most powerful tools in the UNIX environment •an entire family of programs - will see egrep(1) later •concepts subsequently incorporated into other programs and languages; e.g. vi(1) , sed(1) , awk(1) , Perl, Python looks for patterns in a text file
Image of page 13
14 grep general form: grep [ options ] pattern [ files ]
Image of page 14
Image of page 15

You've reached the end of your free preview.

Want to read all 62 pages?

  • Spring '14