Bourne shell read bug?

Jeffrey W Percival jwp at larry.sal.wisc.edu
Thu Feb 15 09:29:23 AEST 1990


I am using Ultrix 3.1, and seem to have a bourne shell bug:
I have a shell script like this

	cat file \
	| while read a b c d e f g
	do
	    echo $a $b $c $d $e $f $g
	done

and when I run this, $f and $g appear concatenated in the output.
I can make this error float around, for example $d and $e being
concatenated instead of $f and $g, by inserting string assignments
before the "cat file" statement, e.g. x="xxx".

Is this well known?  Is there a workaround?
-- 
Jeffrey W Percival (jwp at larry.sal.wisc.edu) (608)262-8686



More information about the Comp.unix.questions mailing list