usenet@cps3xx.UUCP (Usenet file owner) (11/22/89)
I am using MINIX 1.2 to teach the OS course and a student wrote the following script which does not terminate. I can not figure out why? Any ideas will be appreciated. 1 #script to find the path to a command 2 #usage: where <command> 3 # 4 if test $# -ne 1; then 5 echo "Usage: $0 <command> 6 exit 1 7 fi 8 9 dir="/bin /usr/bin" 10 for d in $dir; do 11 list="`ls $d`" 12 for name in $list; do 13 if test $1 = $name; then 14 echo $d/$name 15 fi 16 done 17 done 18 exit 0 If one puts an echo "" between lines 16 and 17 it works correctly. -ir (rattan@frith.egr.msu.edu)