I have a script in Bash called Script.sh, and it needs to know its own PID (i.e. I need to get PID inside the Script.sh )
Script.sh
Any idea how to do this ?
The PID is stored in $$.
$$
Example: kill -9 $$ will kill the shell instance it is called from.
kill -9 $$