read bug in 4.4 /bin/sh?

Carl S. Gutekunst csg at pyramid.pyramid.com
Tue Mar 21 05:35:12 AEST 1989


In article <8903201700.AA00197 at era.ucar.edu.UCAR.EDU> era at NIWOT.UCAR.EDU writes:
>#!/bin/sh
>read x < $0
>echo x = $x

Redirection of the "read" command is not supported in the 4.3BSD Bourne shell;
it is supported in the System V Bourne shell. So, this works on SunOS and the
Pyramid's att universe, but does not on Ultrix or the Pyramid's ucb universe.

You can do what you want -- better I think -- using head(1):

	#!/bin/sh
	x=`head -1 $0`
	echo x = $x

<csg>



More information about the Comp.sys.pyramid mailing list