[Top][All Lists]

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

Re: Bash bug in variable assignment/echo/grep -q

From: Roel Van de Paar
Subject: Re: Bash bug in variable assignment/echo/grep -q
Date: Wed, 22 Jun 2016 12:21:59 +1000

Got it, thanks

On Wed, Jun 22, 2016 at 12:21 PM, Chet Ramey <address@hidden> wrote:
On 6/21/16 9:35 PM, Roel Van de Paar wrote:

> Bash Version: 4.2
> Patch Level: 46
> Release Status: release
> Description:
>         DONE=0 at the end of the 'Repeat-By' script - should be 1 ?
> Repeat-By:
>         LINE='test'; DONE=0; echo ${LINE} | if grep -q 'test'; then DONE=1;
> echo "DONE"; fi; echo $DONE

All elements of a pipeline are executed in subshells.  A subshell cannot
affect its parent's environment.  The `lastpipe' shell option can change
this when job control is not active.
``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/


Kind Regards,
God Bless,
Roel Van de Paar, 
CMDBA/CMDEV Senior QA Lead, Percona
Tel: +61 2 8004 1288 (UTC+10)
Mob: +61 427 141 635 (UTC+10)
Skype: percona.rvandepaar

Looking for Replication with Data Consistency?

reply via email to

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