bash

From: Reiner Funck (reiner.funck_at_dwd.de)
Date: 03/30/05


Date: Wed, 30 Mar 2005 12:31:30 +0200

hallo,

I have a little problem with bash

my a.out makes only printf(..., getpid(), getppid())

echo $$; ( a.out; v=1; )

results:

8093
27760 27759

8093 for PID of terminal-shell, 27759 for subshell
of '(...)' and 27760 for subshell of a.out.

What happens with:

echo $$; ( a.out; )

8093
27780 8093

one subshell "fails", why?

I have not found anything in man page.

Many thanks for help, Reiner



Relevant Pages

  • Re: run binary executable with . in bash?
    ... > in the current shell context, ... > Is there any way for bash to run a binary executable without spawning ... > preceding the call to my program, bash spawns a subshell to execute ... > PID where I want it to go. ...
    (comp.unix.shell)
  • Re: variable in subshells with bash
    ... On Mon, 29 Mar 2004 at 20:20 GMT, Peter Holtermann wrote: ... > user dont want to wait he can kill it with a gdialog button: ... subshell, you need to put this after the call. ... > kill $PID ...
    (comp.unix.shell)
  • bug in sh or misinterpretation?
    ... The idea is to be able *in the subshell* to cleanup a backgrounded ... PID TT STAT TIME COMMAND ... I even tried debugging (i'm about to build sh with debugging ...
    (freebsd-questions)
  • Re: (kill -1 $$)
    ... The value of $$ does not change when you fork a subshell with. ... seems odd, but that's the defined behavior: it's the PID of the last *exec'ed* ... shell in the process' ancestry, ...
    (comp.unix.shell)
  • Re: PID of subshell forked with ()
    ... : Dan Jacobson wrote: ... :>John DuBois wrote: ... :>PID of the subshell I'm in? ...
    (comp.unix.shell)