Using awk

Error messages

Generally, if you make an error in your awk program, you get an error message. For example:

   $3 < 200 { print ( $1 }
This program generates the following error messages:
   awk: syntax error at source line 1
    context is
           $3 < 200 { print ( $1 >>> } <<<
   awk: illegal statement at source line 1
            1 extra (
Some errors might be detected while your program is running. For example, if you try to divide a number by zero, awk stops processing and reports the input record number (NR) and the line number in the program.
Next topic: Patterns
Previous topic: A handful of useful one-liners

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005