bug-bash
[Top][All Lists]
Advanced

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

Re: push cannot be redirected in 4.1.5


From: Greg Wooledge
Subject: Re: push cannot be redirected in 4.1.5
Date: Wed, 30 Apr 2014 17:17:27 -0400
User-agent: Mutt/1.4.2.3i

On Wed, Apr 30, 2014 at 02:04:02PM -0700, Viktor Szépe wrote:
> I am surprised of these different values:
> 
> echo "MAIN $BASHPID" ; echo "first $BASHPID" >&2 | echo "subshell $BASHPID"
> MAIN 30551
> subshell 8514
> first 8513
> 
> Why neither side of the pipe has pid 30551?
> Why are TWO new subshells needed?

Each command of a pipeline is run in a subshell.

There is one exception: the LAST command in the pipeline MAY be run in
the parent shell, if the lastpipe option is set.  This option was added
in bash 4.2 and does not work with job control enabled.

AT&T Korn shell (ksh88 and ksh93) has always run the last pipeline
command in the parent shell.  However, pdksh does NOT do it (at least,
last time I tried it).



reply via email to

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