If you put filenames on the command line, a typical UNIX command will
read those files.
With no filenames, the command will read its standard input.
How can you make the command read both files and standard input?
Some UNIX systems, and utilities such as
support a special name like
Some older UNIX commands, like
will accept a "filename" of
There's not actually a file named
; it's just a shorthand
for "read standard input."
This syntax might change in the future.
For instance, here's how to compare two files on different computers.
sends a copy of the file bin/aprog
from the remote host snooze
down the pipe here on the local computer.
compares the local file aprog.new
to the standard input
from the pipe:
rsh snooze cat bin/aprog | diff - aprog.new
For more examples, see articles