Here is the script (I know this can be done in a much cleaner way in awk, but I like this way)
#!/bin/sh
P="master(-worker)?"
PS=/bin/ps
SED=/bin/sed
KILL=/bin/kill
GREP=/bin/grep
CUT=/usr/bin/cut
$KILL `$PS ax | $GREP -E $P | $GREP -v grep | $SED -e 's/^\ \+//g' | $CUT -d ' ' -f 1 | $GREP -E '^[[:digit:]]+'`
--
= ^ . ^ =
No comments:
Post a Comment