Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • In awk scripts where I need many quotes, I set up a var as -vq=\" or even {q=sprintf("%c",34)} Commented Apr 25, 2020 at 4:34
  • 1
    Always: BEGIN { SQ = "\047"; DQ = "\042"; } Commented Apr 25, 2020 at 12:39
  • @Paul_Pedant Thanks, that makes it more readable. Commented Apr 25, 2020 at 12:47
  • I would normally assemble the whole command like: cmd = sprintf ("file %s", SQ filename SQ); (a) Easy to debug. (b) You should close the pipework with close (cmd) after use. Commented Apr 25, 2020 at 12:51
  • 1
    @Paul_Pedant :-) I will leave this comment thread be for now, as it's on a topic tangential to the question. Commented Apr 25, 2020 at 16:52