[net.unix] How to convert csh to sh?

harris@imsvax.UUCP (Harris Reavin) (12/12/85)

(bug food)

     I have a csh script that does a mail merge that I want to convert to a
Bourne shell script. Can anyone show me how to do it. My main problem is
the "for" loop. I do not know how to give it numeric arguments. The input
consists of 4 line addresses separated by a blank line. The headerfile
has the date and some blank lines. The textfile has the body of the letter.
-------------------------------------------------------------------------
#
while ($status == 0)
	cat headerfile
	foreach i (0 1 2 3 4)
		set argv = ($<)
		if ($i == 0) then
			set line = ($argv:x)
		endif
		echo $argv
	end
	if ($#line != 3) then
		exit
	endif
	echo Dear $line[1] $line[3]':' 
	cat textfile
end
------------------------------------------------------------------------

Thanks for any help.
-- 
		                        Harris Reavin

UUCP:	{umcp-cs!eneevax || seismo!rlgvax!elsie}!imsvax!harris