Archaic wrote these words on 03/01/06 01:02 CST: > Oh bollocks!
Not sure what bollocks means, but if it means "I'm totally confused, on what the original statement is, but I'll post something anyway", then it is an accurate word. > Wrong: > JUSTFORBRUCE=`echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\\${COUNTER}/"` > > Right: > JUSTFORBRUCE=`echo ${BIGSTRING} | sed "s/^.*\($MYSTRING\).*$/\${COUNTER}/"` This simply isn't an accurate statement and will not work as designed. It is obvious the author didn't try it or test it. Because if he had you would not be reading this. What is written below "Right:" will result in the value of ${COUNTER} being returned, not the backreference. It should be quite obvious, without even testing, that an escaped variable will result in that variable being returned in this example. And we were not looking for the value of the variable, instead we want that variable to designate a backreference. The backslash in Archaic's example serves to escape the "$" sign, (and is very effective in that, mind you). Now without any other backslash, I would like Archaic to explain how he'll get a backreference from his construct. -- Randy rmlscsi: [GNU ld version 2.15.94.0.2 20041220] [gcc (GCC) 3.4.3] [GNU C Library stable release version 2.3.4] [Linux 2.6.10 i686] 10:20:01 up 15 days, 18:29, 3 users, load average: 1.16, 1.07, 0.76 -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page