whiteinge/salt — comment on commit 8d7943735aed81c17dc15749db2145052e48e408
File: debian/salt.salt-master.init line 49
By SEJeff:

Untested, but this should do the right thing
```PROC_LIST=`$PS_CMD | grep -Ev 'sh|vi' | awk '/bin\/python.*salt-maste[r]/{ print $1 }'````

Couple of things here:
```ps -ef | grep -v grep | grep foobar```

is equivalent to below. The shell does the "right thing TM" with the bracket match. Note that you can wrap the brackets around any letter, but only a single one.
```ps -ef | grep fooba[r]```

This:
```ps -ef | grep -v foo | grep -v bar```

is equivalent to either of these:
```ps -ef | grep -vE 'foo|bar'```
```ps -ef | egrep -v 'foo|bar'```

technically egrep is "discouraged" in favor of grep -E per the latest POSIX draft, but both will work on any POSIX environment.

awk == grep + cut. These 2 commands are identical except the second one uses less fork/execs:
```ps -ef | grep '\/sbin\/ini[t]' | awk '{print $NF}'```
```ps -ef | awk '/\/sbin\/ini[t]/{print $NF}'```