Error in 4.2 BSD Bourne shell quoting

Guido van Rossum guido at mcvax.UUCP
Tue Oct 25 00:52:07 AEST 1983


The following shell script doesn't work with the 4.2 BSD Bourne shell (sh):
	BIN=/bin
	: ${ECHO="$BIN/echo"}
	$ECHO $ECHO
It replies with sh: /bin/echo: not found.
The direct reason is that the variable ECHO has all the high order
bits set (this was verified by exporting it and checking the environment
from a C program).  Probably the shell forgets to remove these bits
(that it internally uses to remember quoted characters).
Note that the following three alternatives for the second line all work:
	: ${ECHO="/bin/echo"}
	: ${ECHO=$BIN/echo}
	ECHO="$BIN/echo"
The V7 shell on our PDP doesn't have the error.
-- 
Guido van Rossum, {philabs,decvax}!mcvax!guido
Centre for Mathematics and Computer Science, (CWI, formerly MC), Amsterdam



More information about the Comp.bugs.4bsd.ucb-fixes mailing list