Created SC2009 (markdown)

nathandarnell
2014-05-07 19:23:47 -07:00
parent 1b0b4d5e1c
commit 838e62d61f

12
SC2009.md Normal file

@@ -0,0 +1,12 @@
# SC2009 Consider using pgrep instead of grepping ps output.
## Problematic Code:
`ps ax | grep -v grep | grep "$service" > /dev/null`
## Correct Code:
`pgrep -f "$service" > /dev/null`
## Source
This seemed to work for me but I am no expert.