Comment 2 for bug 102208

Revision history for this message
Peter Cordes (peter-cordes) wrote :

Ubuntu AMD64 8.10.

peter@tesla:~$ echo '\' | mawk '{ gsub( /\\/, "\\\\" ); print }'
\
peter@tesla:~$ echo '\' | mawk '{ gsub( /\\/, "\\ \\" ); print }'
\ \

The syntax is fine, it's all single-quoted. The submitter left out a print, though. You can check that mawk is getting the right args and input with
strace -eexecve,read,write mawk
That produces a veritable forest of backslashes, so you can definitely see that they're not being eaten by bash.

There seem to be a few bugs in mawk's gsub: e.g.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=100808

 This bug is a different kind of wrong matching of regexes, so I didn't mark this bug as being the same bug, though.