mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2009 (markdown)
@@ -18,7 +18,7 @@ If you are just after a pid from a running program, then pgrep is a much safer a
|
|||||||
|
|
||||||
If you want a field that's not the pid, consider doing this through `ps` + `pgrep` instead of `ps` + `grep`:
|
If you want a field that's not the pid, consider doing this through `ps` + `pgrep` instead of `ps` + `grep`:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
for pid in $(pgrep '^python$')
|
for pid in $(pgrep '^python$')
|
||||||
do
|
do
|
||||||
user=$(ps -o user= -p "$pid")
|
user=$(ps -o user= -p "$pid")
|
||||||
|
Reference in New Issue
Block a user