I read this example in a book:
cp /bin/cat proj33
echo -n x | ./proj33 - pipe33a > pipe33b &
./proj33 <pipe33b >pipe33a &
What do the symbols -, > and < mean?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
>is I/O redirection; it sends the standard output of the command (./proj33) to the filepipe33b.The
<symbol is also I/O redirection; it sends the standard input of the command (./proj33again) from the filepipe33b.The
-is just an argument. It is often treated by commands as an indication to read standard input instead of a file. In this context, it is likely thatproj33normally requires a file as its first argument, but it reads from the pipe when the argument is-. Sometimes, the-is used to indicate standard output. In extreme cases, you can get one-indicating standard input and one indicating standard output on a single command. With GNUtar, you could havetar -c -f - -T -with the output being written to standard output (-f -) and the list of files to be archived read from standard input (-T -).If you see
--, that is very different; it indicates the ‘end of options’ for the command; anything that follows is not an option, even if it starts with a dash-.