Date: Thu, 11 Sep 2025 11:53:11 -0400
From: Ken Hornstein <[email protected]>
Message-ID: <[email protected]>
| "cp %f /tmp/foo.$$.jpg; (xv /tmp/foo.$$.jpg; rm -f /tmp/foo.$$.jpg) &"
|
| Okay, that might not work right off the bat because I'm not sure what $$
| will expand to in the subshell,
In a shell (including all its subshells) $$ expands to the same thing.
It neither is, nor has ever been, "the pid of the current sh process",
unless that process happens to be the top level shell environment.
Once a shell starts, $$ is a constant throughout all code that shell
runs (the only way to get a different $$ is explicitly (incl via #!)
invoke a new shell).
So, whatever other issues that fragment might have (and I see none after
no more than reading your message) there is nothing wrong with the usage
of $$ there which would break anything.
kre
ps: xv however is kind of dated! It must be, as I still use it as well,
and I am very dated.