manpagez: man pages & more
info gawk
Home | html | info | man

File: gawk.info,  Node: Output Exercises,  Prev: Output Summary,  Up: Printing

5.12 Exercises
==============

  1. Rewrite the program:

          awk 'BEGIN { print "Month Crates"
                       print "----- ------" }
                     { print $1, "     ", $2 }' inventory-shipped

     from *note Output Separators::, by using a new value of 'OFS'.

  2. Use the 'printf' statement to line up the headings and table data
     for the 'inventory-shipped' example that was covered in *note
     Print::.

  3. What happens if you forget the double quotes when redirecting
     output, as follows:

          BEGIN { print "Serious error detected!" > /dev/stderr }

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.