in reply to Re^2: How to read from shell command and terminate it afterwards?
in thread How to read from shell command and terminate it afterwards?

True. He said:

This command outputs to stdout [a] few lines of information, which I am looking for ...

"a few" is generally more than two, and less than say 10. "a few" emphasizes the fact that the number, while small, is not zero but more than two.

But mostly it suggests he knows how many.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

  • Comment on Re^3: How to read from shell command and terminate it afterwards?

Replies are listed 'Best First'.
Re^4: How to read from shell command and terminate it afterwards?
by ikegami (Patriarch) on Feb 11, 2012 at 02:31 UTC

    No, it does not suggest he knows (exactly) how many. In fact, the OP was pretty clear that the length of the output depends on external factors.

    He *may* know exactly how many lines he needs to read, so I'm not saying that your solution isn't viable. I'm just answering your question.

Re^4: How to read from shell command and terminate it afterwards?
by chessgui (Scribe) on Feb 10, 2012 at 10:02 UTC
    What if this small number varies :) ? It can be three, two, five, depending on the circumstances? Then relying on that number can lead to data loss or blocking read.