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.
Loading...
Related Quiz
- What is the primary purpose of the chmod command in Linux?
- Which command is primarily used to view the routing table in Linux?
- After the kernel is loaded, which system initializes services and system features?
- For a package manager, what is the significance of the "dependency resolution" process?
- AppArmor policies are commonly defined using which type of files?