A couple of months ago I ran into a quoting problem with awk. I was trying to multi-escape a single quote correctly so that bash would hand them to awk to place in the output.
Turns it that it can't be done! The quoting and escaping rules for bash collide with those for awk in a way that make it impossible to pass a single quote all the way through.
This solution is about one step before what I wanted:
http://stackoverflow...awk-inside-printf
Wade.