Gawk/Output-Exercises
From Get docs
Previous: Output Summary, Up: Printing [Contents][Index]
5.12 Exercises
Rewrite the program:
awk 'BEGIN { print "Month Crates" print "----- ------" } { print $1, " ", $2 }' inventory-shipped
from Output Separators, by using a new value of
OFS
.- Use the
printf
statement to line up the headings and table data for theinventory-shipped
example that was covered in Theprint
Statement. - What happens if you forget the double quotes when redirecting
output, as follows:
BEGIN { print "Serious error detected!" > /dev/stderr }