Daniel Jacobowitz <drow@xxxxxxxxx> writes: > > ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' > > ac_i=`echo "$ac_i" | sed "$ac_script"` > > By the way, something I noticed a few months ago when fixing quoting > bugs in GCC: this style of code triggers all sorts of problems with dash > (formerly called ash) at least as of 0.4.21 and a few earlier versions. > For example: > > $ a='a\b' > $ set | grep '^a=' > a='a\b' > $ echo "$a" > a > $ > > i.e. the \b is processed. This interacts very badly with > --program-transform-name='s/g\(.*\)/g\1-3.4/', Hmm, but your script doesn't necessarily indicate any problem with --program-transform-name. POSIX says that the last echo is equivalent to $ echo 'a\b' and that the results are implementation-defined, since 'echo' has undefined behavior if its operands contain a backslash. (On XSI-conformant systems, the system must print a backslash; perhaps that's what ash did.) --program-transform-name doesn't pass backslash to echo, so it won't run into that problem. For example, with POSIX you must get this behavior: $ a='a\b' $ expr "X$a" : 'X\(.*\)' a\b