shell script question

Doug Gwyn gwyn at smoke.BRL.MIL
Sun Mar 4 10:42:07 AEST 1990


In article <652 at sagpd1.UUCP> jharkins at sagpd1.UUCP (Jim Harkins) writes:
>	sed 's/foo/$i/' < $i > tmp
>But what this does is replace 'foo' with '$i', not the filename.

Not surprising when you consider that the shell does not perform variable
substitution within ''-quoted strings.  Use "" instead, or arrange for the
$i to be outside the quotes.



More information about the Comp.unix.questions mailing list