On Wed, Sep 21, 2011 at 01:09:32PM -0400, Pete Nelson wrote:
> I'm confused about what exec is doing in this case.
>
> Sample script t:
>
> #!/bin/bash
> echo $0 pid: $$ ppid: $PPID args: $* 1>&2
> if [ -z "$1" ]; then
> exec $0 first | $0 second
> echo should not reach here
> fi
It does not
Pete Nelson writes:
> I'm confused about what exec is doing in this case.
>
> Sample script t:
>
> #!/bin/bash
> echo $0 pid: $$ ppid: $PPID args: $* 1>&2
> if [ -z "$1" ]; then
> exec $0 first | $0 second
> echo should not reach here
> fi
>
> output:
>
> $ ./t
> ./t pid: 13746 ppid: 12823 ar