C-shell programming

Paul Chamberlain tif at doorstop.austin.ibm.com
Sat Aug 4 04:41:13 AEST 1990


In article <230 at jabberwock.shs.ohio-state.edu> reiner at jabberwock.shs.ohio-state.edu (Reiner Wilhelms) writes:
>I'd like to create a c shell program which reads from 3 files and
>generates 1 (or more ) output file(s). 
>Calling this csh script will look like this:
>	% my_shell_script input1 input2 input3  output

A bourne shell script could use the 3< 4< etc. syntax like this

	:
	(
	read from_filename1 <&3
	read from_filename2 <&4
	read from_filename3 <&5
	echo to_filename_4 >&6
	) 3< $1 4< $2 5< $3 6> $4

I haven't tried this but it's at least close.  I don't think
csh has an equivalent feature.  I think you can use "{" and "}"
instead of "(" and ")" to be more efficient (one less process).

Paul Chamberlain | I do NOT represent IBM         tif at doorstop, sc30661 at ausvm6
512/838-7008     | ...!cs.utexas.edu!ibmaus!auschs!doorstop.austin.ibm.com!tif



More information about the Comp.unix.questions mailing list