bug-bash
[Top][All Lists]
Advanced

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

Re: while read subcommand problem


From: Paul Jarc
Subject: Re: while read subcommand problem
Date: Fri, 02 Mar 2007 13:17:16 -0500
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.4 (gnu/linux)

Andreas Schwab <schwab@suse.de> wrote:
> prj@po.cwru.edu (Paul Jarc) writes:
>> while ...; do var=...; done <<EOT
>> $(generate-input-for-while)
>> EOT
>> use "$var"
>
> This has the disadvantage that generator and consumer no longer run
> concurrently.  Process substitution does not have this problem.

True.  The here-document with command substitution also removes any
trailing newlines from the output, then adds back just one newline.
But it is more portable to other shells.


paul




reply via email to

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