Arguments to 4.3BSD "sh -c" commands are mishandled

Kent Black kab at reed.UUCP
Tue Dec 16 08:55:18 AEST 1986


In article <7296 at elsie.UUCP> ado at elsie.UUCP (Arthur David Olson) writes:
 = Index:	bin/sh 4.3BSD
 = 
 = Description:
 = 	Arguments to a "sh -c" command are mishandled.
 = 
 = Repeat-By:
 = 	Type in the command
 = 		sh -c 'echo $*' a b c d
 = 	and note the incorrect output:
 = 		b c d

This is not a bug; $* expands to $1 - $n, i.e.,
skips $0, which happens to be 'a'. 
Try
	sh -c 'echo $0' a b c

-- kab



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