gawk: Print
1
1 5.1 The 'print' Statement
1 =========================
1
1 Use the 'print' statement to produce output with simple, standardized
1 formatting. You specify only the strings or numbers to print, in a list
1 separated by commas. They are output, separated by single spaces,
1 followed by a newline. The statement looks like this:
1
1 print ITEM1, ITEM2, ...
1
1 The entire list of items may be optionally enclosed in parentheses. The
1 parentheses are necessary if any of the item expressions uses the '>'
1 relational operator; otherwise it could be confused with an output
1 redirection (⇒Redirection).
1
1 The items to print can be constant strings or numbers, fields of the
1 current record (such as '$1'), variables, or any 'awk' expression.
1 Numeric values are converted to strings and then printed.
1
1 The simple statement 'print' with no items is equivalent to 'print
1 $0': it prints the entire current record. To print a blank line, use
1 'print ""'. To print a fixed piece of text, use a string constant, such
1 as '"Don't Panic"', as one item. If you forget to use the double-quote
1 characters, your text is taken as an 'awk' expression, and you will
1 probably get an error. Keep in mind that a space is printed between any
1 two items.
1
1 Note that the 'print' statement is a statement and not an
1 expression--you can't use it in the pattern part of a pattern-action
1 statement, for example.
1