Randy McMurchy wrote:
On Tue, 2006-02-28 at 20:35 -0600, I wrote:
echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\\${COUNTER}/"
The word "string" was returned, as expected.
JUSTFORBRUCE=`echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\\${COUNTER}/"`
echo $JUSTFORBRUCE
Woops, we didn't get what we wanted. We got ${COUNTER} instead
Now that I think about it further, I still consider `...` broken. Here's
why:
It works one way when not used assigning a variable and works completely
different when using *exactly the same syntax* to assign it to a
variable.
To me, this inconsistency is broken behavior.
Are you using the above example as proof of this? I would just like to
clarify that because in the lines above, you have `...` in the second
line where you assign it to the variable, but not in the first line
where you're running the command at the prompt.
See:
$ echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\\${COUNTER}/"
string
$ `echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\\${COUNTER}/"`
-bash: ${COUNTER}: command not found
$
If you meant something else, I'd appreciate another example. :)
--
JH
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page