O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The print statement

So far, we have been using print statements mainly to produce simple yet standardized output. With a print statement, we specify the expressions to print as a list separated by commas. The output is separated by single spaces, followed by a newline. The print statement has two forms:

print expr1, expr2, ……, exprnprint (expr1, expr2, ………, exprn)

Both print the string value of each expression separated by the Output Field Separator (OFS); the default is a single space followed by the Output Record Separator (ORS); the default is newline. Using parentheses is necessary if an expression uses the > relational operator to mark its differentiation from redirection operator. Here expression could be any AWK expression or any constant ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required