1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 17:18:02 +00:00

Add PID Of The Current Shell as a unix til

This commit is contained in:
jbranchaud
2016-05-27 12:02:11 -05:00
parent 22c1e1aae9
commit 102b2f566a
2 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
# PID Of The Current Shell
`$` expands to the process ID of the shell. So, you can see the PID of the
current shell with `echo $$`.
```bash
> echo $$
36609
> zsh
> echo $$
45431
> exit
> echo $$
36609
```
See the `Special Paramaters` section of `man bash` for more details.
[source](http://stackoverflow.com/questions/21063765/get-pid-in-shell-bash)