GNU Info

Info Node: (gawk.info)Getline Notes

(gawk.info)Getline Notes


Next: Getline Summary Prev: Getline/Variable/Coprocess Up: Getline
Enter node , (file) or (file)node

Points About `getline' to Remember
----------------------------------

   Here are some miscellaneous points about `getline' that you should
bear in mind:

   * When `getline' changes the value of `$0' and `NF', `awk' does
     _not_ automatically jump to the start of the program and start
     testing the new record against every pattern.  However, the new
     record is tested against any subsequent rules.

   * Many `awk' implementations limit the number of pipelines that an
     `awk' program may have open to just one.  In `gawk', there is no
     such limit.  You can open as many pipelines (and coprocesses) as
     the underlying operating system permits.

   * An interesting side effect occurs if you use `getline' without a
     redirection inside a `BEGIN' rule. Because an unredirected
     `getline' reads from the command-line data files, the first
     `getline' command causes `awk' to set the value of `FILENAME'.
     Normally, `FILENAME' does not have a value inside `BEGIN' rules,
     because you have not yet started to process the command-line data
     files.  (d.c.)  (*Note The `BEGIN' and `END' Special Patterns:
     BEGIN/END, also *note Built-in Variables That Convey Information:
     Auto-set..)


automatically generated by info2www version 1.2.2.9