http://qs321.pair.com?node_id=277171


in reply to Re: reading output from another script
in thread reading output from another script

This assumes the stream would be line oriented. Of course that should be true for most circumstances (he even mentions tail -f). But if it is not things get a bit more tricky and he would need to read character by character by some low level system call.
  • Comment on Re: Re: reading output from another script

Replies are listed 'Best First'.
Re: reading output from another script
by Abigail-II (Bishop) on Jul 23, 2003 at 14:53 UTC
    Well, yeah, and things could even be more tricky if the read in characters are in some strange encoding, and an obscure language. ;-)

    I read the article from the OP as if (s)he had problems with the fact that the source (s)he's reading from continues to produce data - not that (s)he needed help with non line oriented input. But even if you want to read byte by byte, just do a S/ = \1 before reading.

    Abigail