Output Exercises (The GNU Awk User’s Guide)
From Get docs
Gawk/docs/latest/Output-Exercises
Previous: Output Summary, Up: Printing [Contents][Index]
5.12 Exercises
- Rewrite the program:
awk 'BEGIN { print "Month Crates" print "----- ------" } { print $1, " ", $2 }' inventory-shipped
- Use the
printf
statement to line up the headings and table data for theinventory-shipped
example that was covered in The print Statement. - What happens if you forget the double quotes when redirecting output, as follows:
BEGIN { print "Serious error detected!" > /dev/stderr }