Re: exec vs. source spawning piped commands

2011-09-22 Thread Greg Wooledge
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

Re: exec vs. source spawning piped commands

2011-09-22 Thread Andreas Schwab
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