bug-bash
[Top][All Lists]
Advanced

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

Re: Bash cannot kill itself?


From: Clark J. Wang
Subject: Re: Bash cannot kill itself?
Date: Wed, 30 Jun 2010 13:25:12 +0800

On Wed, Jun 30, 2010 at 1:17 PM, Jan Schampera <jan.schampera@web.de> wrote:

> Chris F.A. Johnson wrote:
>
>   $$ refers to the subshell.
>>>>
>>>
>>> There's no subshell here, I think.
>>>
>>
>>   The background process invoked by &.
>>
>
> $$ is meant to always report the "main shell", I'd guess this is true for
> this case, too.
>
> Running a cmd in background (by &) would not create subshell. Simple
testing:

#!/bin/bash

function foo()
{
    echo $$
}

echo $$
foo &

### END OF SCRIPT ###

The 2 $$s output the same.

> J.
>
>


reply via email to

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