4

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?

2
  • 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.
    – n0pe
    Dec 15, 2011 at 0:37
  • This would require solving the halting problem Dec 21, 2011 at 1:03

1 Answer 1

7

(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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .