[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: value of $$ in backgrounded process
From: |
Leonid Isaev (ifax) |
Subject: |
Re: value of $$ in backgrounded process |
Date: |
Wed, 6 Oct 2021 18:39:40 +0000 |
User-agent: |
Mutt/1.13.4 (2020-02-15) |
On Wed, Oct 06, 2021 at 04:20:36PM +0200, kovacs istvan wrote:
> what should $$ expand to in a backgrounded process?
> Currently it will expand to the main process ID. Is this fixed, or
> implementation specific?
Is it possible that you are looking for BASHPID?
-----8<-----
I-akula-++-14:38-tmp-> echo -E "$$"; { echo -E " $$ -- $BASHPID"; sleep 5; } &
7328
[1] 7645
7328 -- 7645
----->8-----
HTH,
--
Leonid Isaev