Transcript document

CS311 – Lecture 13 Outline
• Midterm I - What to expect
• Worksheet 3
Note: These lecture notes are not intended replace your notes. This is
what I expect your notes to already look like, but with more explanation as
needed.
Lecture 13
CS311 – Operating Systems 1
1
Midterm 1 – What to expect
• You will absolutely write a small Bash program.
– if statements with test utility
– $#, $1, $2
– for var in list
do
...
done
– command substitution: ` your command here `
– variable substitution
– shebang line
Lecture 13
CS311 – Operating Systems 1
2
Midterm 1 – What to expect
• You will absolutely write a small perl program
– You will NOT be allowed to embed bash commands inside
your perl program
– $scalers and @arrays
– loop through the elements of an array
– use if statements
– use the match operator m// with regular expressions
– "remember" things with ( ) and recall with $1, $2, ...
– write an array to a file
Lecture 13
CS311 – Operating Systems 1
3
Midterm 1 – What to expect
• You will absolutely be tested on regular expressions
–
–
–
–
–
–
–
–
–
–
–
.
*
+
?
^
[^abc]
$
()
[1-9]
\b
\
Lecture 13
CS311 – Operating Systems 1
4
Midterm 1 – What to expect
•
•
•
•
•
•
Organization of Unix
Process state diagram
Process image in virtual memory diagram
Redirection to a file: >, <, >>
Reading from a here document: <<
Using pipes | to connect utilities
Lecture 13
CS311 – Operating Systems 1
5
Midterm 1 – What to expect
• Absolutely know how to use: sed
– delete a specific line: sed "5 d" filename
– delete any line matching a regex: sed "/^[1-9]/ d" filename
– substitute: sed -r "s/\bBugs\b/Easter/g" filename
• tr
– delete characters: tr -d 'aeiou' < filename
– translate characters: tr 'abc' 'ABC' < filename
• grep
– know these options: -n, -E, -c
• awk - be able to interpret an awk script and write
down its output for a given file
Lecture 13
CS311 – Operating Systems 1
6
Midterm 1 – What to expect
• How do you run a process in the background?
• Know the utilities that we have discussed in class.
They appear in previous NOTES.
• Unix / Linux filesystem security via what 2
mechanisms?
• filename wildcards: ? * []
• multprogramming and timesharing
If we didn't have a multiprogramming OS what would
be missing?
– 1) Only one user at a time
– 2) That one user could run only one process (application)
at a time
Lecture 13
CS311 – Operating Systems 1
7