help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] does bash stop children processes when reading from them


From: Chet Ramey
Subject: Re: [Help-bash] does bash stop children processes when reading from them??
Date: Tue, 25 Nov 2014 08:27:15 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 11/25/14, 7:09 AM, R . wrote:
> alright, say we have this:
> 
> while read line; do echo "$line"; done < <(func_or_process)
> 
> when doing piping and redirection, does bash run "func_or_process" all in one 
> go, then dump all the output to an intermediate file then makes use of them 
> for the rest of the commands??

No, `func_or_process' is run asynchronously.

> or does bash halt the process like sending a SIGTSTP right after 
> func_or_process flushes it's output buffer?? then uses that value for the 
> iteration and then SIGCONT it at the very beginning of another iteration?

No.


> does it matter if it's a function or a process?? i'm asking as i want to know 
> if it's still worth using command substitution at all.

I assume that by `process' you mean external command.  No, it doesn't
matter.

You're not using command substitution; your example uses process
substitution.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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