CS/CE 218 Quiz #5 September 27, 1991 Name: TA: For all of the following, assume that the PATH variable is defined (as usual) as ``:/bin:/usr/bin:/usr/contrib/bin:/usr/local/bin''. 1. (5 pts) Suppose the file ``question1'' in the current working directory is as follows. ---------------------------------------- #! /bin/sh echo one ${3} two `echo $2` 'one' "$1" ---------------------------------------- Assuming that the file question1 is executable, what is the output of the following command? (Put a box around the characters of your answer) question1 first "second" 'third' 2. (10 pts) Suppose the file ``question3'' in the current working directory is as follows. ------------------------------------------ #! /bin/sh if test $# -eq 0 then echo "Usage" >&2 exit 1 fi for f do if test -w $f then rm $f && echo "removed $f" || exit 1 fi done echo successfully removed $* exit 0 ------------------------------------------ a. Assuming that each time ``rm'' is executed it is successful, What is printed on STANDARD OUTPUT by the following command? question3 f1 g2 b. What is printed on the STANDARD OUTPUT by the following command? question3