Question

What is the meaning of $$ in KornShell? I guess it is associated with the process ID, but I want to know its exact meaning.

Was it helpful?

Solution

$$ is the process id of the ksh process itself; $PPID is the process id of its parent.

Here's the ksh (93) documentation for special parameters (it's after the fold). Same info for ksh88.

OTHER TIPS

It is used for making temporary names with the process id. Say you need a file name but that name needs to be unique to the process you are in - so if more than one person runs the same ksh script they will not step on each other.

$$ is in bash, sh and other UN*X shells.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top