On AIX 7.2 awk, the sub and gsub functions have a bug when the
replacement string contains a "\1" character. The substituted
strings have \1 characters replaced with amperands, for example:
Very strange. The problem is internal to (g)sub, there is no
problem using "\1" characters in other contexts -- including
with the other arguments to (g)sub. It should be fine to use
"\2" instead which avoids this particular bug.