bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] builtin read from pipe (echo foo | read) does not affect the r


From: Paul Jarc
Subject: Re: [BUG] builtin read from pipe (echo foo | read) does not affect the result variable
Date: Wed, 12 Dec 2001 11:17:46 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 (i386-redhat-linux-gnu)

"Eddy Razanajatovo" <e.razanajatovo@x-media.fr> wrote:
> Caveats:
> The workaround requires filespace space in a temporary directory, and
> commands do not perform concurrently, as in the following example:
>
> #!/bin/bash
> (
>     perform_something_that_generates_a_big_file_on_stdout
> ) | (
>     while read
>     do
>         manage_a_result_line $REPLY
>     done
> )

This does not require any temporary space in the filesystem.  In this
specific case, the parentheses are unnecessary as well.

> Note that this affects bash even if it is invoked in Bourne-Shell mode using
> "sh" or "/bin/sh" instead of "bash".
> So the above example must be rewritten as:

No rewriting is necessary; the above will work.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]