This also breaks the following script:

  target='\1.o'
  echo foo.c | sed -e 's/\([a-z]*\).c/'$target'/'

Ubuntu /bin/dash:
$ target='\1.o'
$ set -x
$ echo foo.c | sed -e 's/\([a-z]*\).c/'$target'/'
+ echo foo.c
+ sed -e s/\([a-z]*\).c/1.o/
1.o

Ubuntu /bin/bash:
$ target='\1.o'
$ set -x
$ echo foo.c | sed -e 's/\([a-z]*\).c/'$target'/'
+ sed -e 's/\([a-z]*\).c/\1.o/'
+ echo foo.c
foo.o

HP-UX /bin/sh
$ target='\1.o'
$ set -x
$ echo foo.c | sed -e 's/\([a-z]*\).c/'$target'/'
+ echo foo.c
+ sed -e s/\([a-z]*\).c/\1.o/
foo.o

As you can see, sed is called without the backslash in the replacement command 
when dash is used:
  sed ... /1.o/
instead of the expected 
  sed ... /\1.o/

-- 
Wrong escape character processing in dash
https://bugs.launchpad.net/bugs/268929
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to