gawk: Other Inherited Files

1 
1 5.8.1 Accessing Other Open Files with 'gawk'
1 --------------------------------------------
1 
1 Besides the '/dev/stdin', '/dev/stdout', and '/dev/stderr' special file
1 names mentioned earlier, 'gawk' provides syntax for accessing any other
1 inherited open file:
1 
1 '/dev/fd/N'
1      The file associated with file descriptor N.  Such a file must be
1      opened by the program initiating the 'awk' execution (typically the
1      shell).  Unless special pains are taken in the shell from which
1      'gawk' is invoked, only descriptors 0, 1, and 2 are available.
1 
1    The file names '/dev/stdin', '/dev/stdout', and '/dev/stderr' are
1 essentially aliases for '/dev/fd/0', '/dev/fd/1', and '/dev/fd/2',
1 respectively.  However, those names are more self-explanatory.
1 
1    Note that using 'close()' on a file name of the form '"/dev/fd/N"',
1 for file descriptor numbers above two, does actually close the given
1 file descriptor.
1