Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    If B reads standard input you'll need to use a different file descriptor.
    – l0b0
    Commented Jun 25, 2013 at 10:41
  • Why are you backgrounding B?
    – l0b0
    Commented Jun 25, 2013 at 10:42
  • @l0b0 backgrounding is how I would address the "line being processed as input for B separately and instantly" requirement. Commented Jun 25, 2013 at 10:46
  • "Instantly" is not the same as "asynchrously". This solution will end up shuffling lines with B's execution time.
    – l0b0
    Commented Jun 25, 2013 at 10:50
  • interestingly this does not make it faster. I actually have sed as the B-command. A simple example like ls -l && sleep 3 | sed 's/.*/&/' | while read l; do echo $l; done does work though. Commented Jun 25, 2013 at 11:04