21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16 <strong>G<strong>AWK</strong></strong>: <strong>Effective</strong> <strong>AWK</strong> <strong>Programming</strong>$ awk ’BEGIN { print "Here is a single quote " }’⊣ Here is a single quote Judge for yourself which of these two is the more readable.Another option is to use double quotes, escaping the embedded, awk-level double quotes:$ awk "BEGIN { print \"Here is a single quote \" }"⊣ Here is a single quote This option is also painful, because double quotes, backslashes, and dollar signs are verycommon in awk programs.A third option is to use the octal escape sequence equivalents for the single- and doublequotecharacters, like so:$ awk ’BEGIN { print "Here is a single quote " }’⊣ Here is a single quote $ awk ’BEGIN { print "Here is a double quote " }’⊣ Here is a double quote

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!