Home / Unix / Bash / Grouping commands / Subshell (...)
Gotcha with $$
In a subshell, $$ expands to the PID of the parent shell.
echo $$ && ( echo $$; echo $$; )
53011 53011 53011
Home / Unix / Bash / Grouping commands / Subshell (...)
$$
In a subshell, $$ expands to the PID of the parent shell.
echo $$ && ( echo $$; echo $$; )
53011 53011 53011