gawk: Output Exercises
1
1 5.12 Exercises
1 ==============
1
1 1. Rewrite the program:
1
1 awk 'BEGIN { print "Month Crates"
1 print "----- ------" }
1 { print $1, " ", $2 }' inventory-shipped
1
1 from ⇒Output Separators, by using a new value of 'OFS'.
1
1 2. Use the 'printf' statement to line up the headings and table data
11 for the 'inventory-shipped' example that was covered in ⇒
Print.
1
1 3. What happens if you forget the double quotes when redirecting
1 output, as follows:
1
1 BEGIN { print "Serious error detected!" > /dev/stderr }
1