On Wed, Feb 11, 2004 at 12:33:52PM -0800, Paul Eggert wrote: > Jim Meyering <jim@xxxxxxxxxxxx> writes: > > > I've never heard of a shell performing the // -> / substitution > > indiscriminately. > > Me neither. > > Autoconf is littered with code like this: > > 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/', because autoconf eats the backslashes. POSIX appears to allow this behavior. Using here documents works: $ cat <<EOF > $a > EOF a\b $ I don't know if ash is considered an unsuitable shell. I know Debian used to allow it to be used as /bin/sh and no longer does. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer