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.
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. bugs.debian. org/cgi- bin/bugreport. cgi?bug= 100808
http://
This bug is a different kind of wrong matching of regexes, so I didn't mark this bug as being the same bug, though.