DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Programming with awk

Error messages

If you make an error in your awk program, you generally get an error message. For example, trying to run the program

   $3 < 200 { print ( $1 }
generates the 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 may 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 -- 02 June 2005