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.

I noticed this problem when I became confused with pipe, one command send its executing output to the STDOUT, which is the STDIN for the other command, which can read from STDIN.

How do I know if a Linux command can read from STDIN?

Is there a feature to distinguish commands that can read from STDIN from those cannot?

share|improve this question
6  
I think this is a per-application thing. The best way to know is really just to read the man page or test it yourself. –  MaxMackie Dec 15 '11 at 0:37
    
This would require solving the halting problem –  Charlie Somerville Dec 21 '11 at 1:03

1 Answer 1

up vote 5 down vote accepted

(In response to the upvotes on my comment)

There isn't a concrete way of determining if an application reads from STDIN or something else. In general, you'll have to try piping something to it or reading the program's man page.

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.