Node:Special Caveats, Previous:Special Network, Up:Special Files
Here is a list of things to bear in mind when using the
special file names that
gawkis in compatibility mode (see Command-Line Options).
gawkprints a warning message every time you use one of these files. To obtain process-related information, use the
PROCINFOarray. See Built-in Variables.
gawkalways interprets these special file names.1 For example, using
/dev/fd/4for output actually writes on file descriptor 4, and not on a new file descriptor that is
dup'ed from file descriptor 4. Most of the time this does not matter; however, it is important to not close any of the files related to file descriptors 0, 1, and 2. Doing so results in unpredictable behavior.
Older versions of
gawk would interpret these names internally only if the system
did not actually have a
/dev/fd directory or any of the other
special files listed earlier. Usually this didn't make a difference,
but sometimes it did; thus, it was decided to make
behavior consistent on all systems and to have it always interpret
the special file names itself.