taggaの日記: [メモ] Gawk の Special File Names
日記 by
tagga
Cygwin で guile -s /dev/stdin が上手くいかないけど、 awk -f /dev/stdin が上手くいく理由。
Gawk の Info から:
4.7 Special File Names in `gawk'
gawk provides a number of special file names that it interprets internally. These file names provide access to standard file descriptors, process-related information, and TCP/IP networking.
...
gawk provides special file names for accessing the three standard streams, as well as any other inherited open files. If the file name matches one of these special names when `gawk' redirects input or output, then it directly uses the stream that the file name stands for. These special file names work for all operating systems that `gawk' has been ported to, not just those that are POSIX-compliant:
- /dev/stdin
- The standard input (file descriptor 0).
- /dev/stdout
- The standard output (file descriptor 1).
- /dev/stderr
- The standard error output (file descriptor 2).
- /dev/fd/N
- The file associated with file descriptor N. Such a file must be opened by the program initiating the `awk' execution (typically the shell). Unless special pains are taken in the shell from which gawk is invoked, only descriptors 0, 1, and 2 are available.
おお、POSIX でなくてもいいんだ。
[メモ] Gawk の Special File Names More ログイン