diff --git a/SC2009.md b/SC2009.md index bc247ed..9f9e31e 100644 --- a/SC2009.md +++ b/SC2009.md @@ -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`: -``` +```sh for pid in $(pgrep '^python$') do user=$(ps -o user= -p "$pid")