Given this diff command:
./a.out < 1.in | diff - 1.out
What does -
mean after the word diff?
Thanks for the help!
Given this diff command:
./a.out < 1.in | diff - 1.out
What does -
mean after the word diff?
Thanks for the help!
Traditionally, - means stdin (standard input). As you're redirecting, the output of the first command is the input of the second.
diff
in particular,-
is defined as standard input. – Michael Homer Jan 19 '15 at 03:39-
to mean either stdin or stdout, as appropriate. Eg,wget -q -O- http://example.com
dumps the fetched HTML data to stdout (the-q
is for quiet mode so progress info isn't mixed with the HTML). – PM 2Ring Jan 19 '15 at 09:35