What is the meaning of $$
in KornShell? I guess it is associated with the process ID, but I want to know its exact meaning.
$$ 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).
The Korn shell (either ksh88 or ksh93, depending on the age of the system) is a standard part of any modern (commercial) Unix system, e.g. Solaris, AIX, HP-UX. pdksh is often available on BSD or GNU/Linux systems, and a growing number of GNU/Linux systems now offer ksh93, either instead of or in addition to pdksh.
Description. The ksh command invokes the Korn shell, which is an interactive command interpreter and a command programming language. The shell carries out commands either interactively from a terminal keyboard or from a file.
To compare strings one uses "=" for equal and "!= " for not equal. and "-lt" for less than.
$$
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With