On 10/13/2016 08:05 PM, Bob Proulx wrote:
XiaoBing Jiang wrote:
Greg Wooledge wrote:
If you want to ENSURE that the child shell process is replaced by the
external sleep 20, use an explicit exec.
yes, I want to know why bash not optimize this. or any strategy ?
Because it wouldn't save anyt
XiaoBing Jiang wrote:
> Greg Wooledge wrote:
> > If you want to ENSURE that the child shell process is replaced by the
> > external sleep 20, use an explicit exec.
>
> yes, I want to know why bash not optimize this. or any strategy ?
Because it wouldn't save anything significant. Since the parent
WHich docs?
If I do "help test" it states: "All file operators except -h and -L are
acting on the target of a symbolic link, not on the symlink itself, if
FILE is a symbolic link."
Peter
On 14/10/2559 02:00, Łukasz Grabowski wrote:
> Configuration Information [Automatically generated, do not chan
Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash
On Wed, Oct 12, 2016 at 8:23 PM, Greg Wooledge wrote:
> On Tue, Oct 11, 2016 at 07:14:24PM -0700, s7v7nisla...@gmail.com wrote:
> > why bash bahavior like this? is that a bug?
> >
> > if not, why should forked before execute subshell?
>
> Because that's how subshells work. A subshell *is* a fork
Also, perhaps BASH_SUBSHELL should be a readonly like BASHPID is.
- M.
bash resets BASH_SUBSHELL to 0 when executing an EXIT trap, even if the
EXIT trap is executed in a subshell.
echo $(trap 'echo $BASH_SUBSHELL' EXIT; echo $BASH_SUBSHELL)
Actual output: 1 0
Expected output: 1 1
The same does not happen for a signal trap.
echo $(trap 'echo $BASH_SUBSHELL; exit' IN