Schedule
Labs
Assignments
TA office hours
Topic videos
Some course notes
Extra problems
Lecture recordings
a) all lines from the file "staple" containing both an 'x' and a digit
b) either the word "happy" or "sad", depending upon whether or not the number in the file "nail" is greater than 50 (greater than 50 is happy) (assume that the file "nail" contains just one integer and no other data)
a)
grep x staple | grep '[0-9]'Note: No need for ".*" at the beginning or end of the grep expressions as they are not "anchored" to the beginning or end of the line. No penalty for including this, except that it made it less likely that you would get a correct answer because it's more complicated -- Keep It Simple!
b)
if test `cat nail` -gt 50 then echo happy else echo sad fi