Introduction
Announcements

Schedule
Labs
Assignments
TA office hours

Tests, exam

Topic videos
Some course notes
Extra problems
Lecture recordings

Discussion board

Grades so far

3. [8 marks]
The file "file" has the contents:
	echo is a good command
	cat is a bad command

a) What is the output of the following shell script?

	if grep good file
	then
	    echo yes
	else
	    echo no
	fi

Solution:

echo is a good command
yes

(if you don't understand why, try it and experiment!)


b) What is the output of the following (highly unusual) shell script?

	if `grep good file`
	then
	    echo yes
	else
	    echo no
	fi

Solution:

is a good command
yes

(again, if you don't understand why, try it and experiment!)