|
From: | Roel Van de Paar |
Subject: | Re: Bash bug in variable assignment/echo/grep -q |
Date: | Wed, 22 Jun 2016 12:21:59 +1000 |
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 chet@case.edu http://cnswww.cns.cwru.edu/~chet/
[Prev in Thread] | Current Thread | [Next in Thread] |