[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: commands between { }
From: |
Paul Jarc |
Subject: |
Re: commands between { } |
Date: |
Fri, 03 May 2002 12:13:30 -0400 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i686-pc-linux-gnu) |
Jirka Kosina <jikos@jikos.cz> wrote:
> P=0 ; { P=1; echo $P; } | { cat -; echo $P; }
>
> I get
> 1
> 0
>
> Though I would accept
You mean "expect", not "accept".
> 1
> 1
>
> as commands between { } are executed in the same shell, which made P=0.
They are *not* run in the same process. Each command in a pipeline is
run in its own process. See FAQ entry E4.
paul