C shell question about foreach

Boris Burtin 6600bori at ucsbuxa.ucsb.edu
Wed Jun 5 09:30:40 AEST 1991


I'm trying to write a csh script that will execute a series of commands for
every directory that exists in /home/pluto.  This script works if I execute it
while I'm logged in, but it gives me a

	syntax error at line 7: `(' unexpected

when I try to run it from crontab.  I'd appreciate any help I can get!  Here's
the code:

--------
#

set people = `ls /home/pluto`

foreach person($people[*])
  echo $person >> /tmp/test.txt
end

--------

	- Boris Burtin
	(6600bori at ucsbuxa.ucsb.edu)



More information about the Comp.unix.questions mailing list