Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it correct to say that the only difference between the 'input redirection operator' and the 'pipeline operator', is that '<' redirects standard input from a file, and '|' redirects input TO a program?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Both set the standard input to a command. The difference is that the pipe operator connects one command's standard output to another command's standard input, and the file redirection operator connects a file to a command's standard input.

There is also the use of an anonymous pipe to connect the programs when using the pipe operator, which is not required when redirecting from a file. Another thing to bear in mind is that the pipe operator creates a subshell, whereas IO redirection does not.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.