Tag:apue
Article From:https://segmentfault.com/q/1010000012137659
Question:


In the second example, cat < /etc/passwd |./a.out
Is it possible to use the symbol <?
As far as I understand it, is pipeline symbol passing the output of a command as a standard input to another command? So I think the &lt here is redundant. I don’t know if the analysis is correct.

Answer 0:

The &lt here can not be written, they perform the same results, and the process is different.
cat /etc/passwd To pass /etc/passwd as a parameter to cat
cat < /etc/passwd First, the file is opened by shell, then the standard input of cat is redirected to the file descriptor.

Link of this Article: APUE lseek function

Leave a Reply

Your email address will not be published. Required fields are marked *