Introduction
Announcements

Schedule
Labs
Assignments
TA office hours

Tests, exam

Topic videos
Some course notes
Extra problems
Lecture recordings

Discussion board

Grades so far

4.

"for i in *" can be used to loop over all file names in the current directory.

Use this to write shell commands which check whether each file in the current directory contains the string 'good' in the opinion of grep.

For each file containing 'good', output a line of the form

        file is good... file is *very* good.
where "file" is the file name.

Solution:

for i in *
do
    if grep good "$i" >/dev/null
    then
        echo "$i" is good... "$i" is \*very\* good.
    fi
done


[sample midterm from Fall 2012]