help-bash
[Top][All Lists]
Advanced

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

Re: reading from external command


From: Chet Ramey
Subject: Re: reading from external command
Date: Thu, 31 Mar 2022 15:18:50 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 3/30/22 6:32 PM, Peng Yu wrote:
I am not sure how wait for "$!" would work robustly.

You have to capture $! before it can be overwritten by another command. For
instance, you can assign it to another variable.

In the following example, it can not get the error in the input.

Because you didn't do that.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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