Line at a time scripts in csh

Maarten Litmaath maart at cs.vu.nl
Sat Jan 14 22:38:52 AEST 1989


posert at bonnie.ics.uci.edu (Bob Posert) writes:
\I have a file with two words on each line, and want to
\process them in a shell script, but can't figure out
\how to get *the entire line* into a variable.
\I tried:
\	foreach i (`cat file`)
\	#misc processing
\	end
\but i was set to each word, not line.

foreach i ("`cat file`")	# create 1 string
	..."$i"...		# avoid * and friends getting expanded
end
-- 
Lee Harvey Oswald was a patsy.        |Maarten Litmaath @ VU Amsterdam:
                       Or a superman. |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list