In a shell script, which built-in variable represents the process ID of the current script?

  • $PID
  • $PPID
  • $SID
  • $$
The correct answer is d) $$, which represents the process ID (PID) of the current script. This variable is useful when you want to track or manage the script's own process. You can use it for various purposes, such as creating temporary files with unique names or monitoring the script's execution.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *