How to get the PID in current bash shell script
How to get the PID in current bash shell script
Answer:
Use the special variable $$, you can get the PID (Process ID) of the current bash shell script
#/bin/bash
echo $$;
The above script will print the PID to the standard out.
Related posts:
- How to perform syntax check on a bash script?
- How to check the bash shell version
- Convert IP address to HEX in Bash script
- How to make shell script run in low priority
- How to unset an environment variable in bash
Post a Comment