[nycbug-talk] two quick things

Matthew Story matt at tablethotels.com
Thu Jan 5 17:37:04 EST 2012


Decided to share a slick hack to cut the grep program out of the ps resulsts that Jan sent my way as a bug report ... this goes against what I said in the talk about there not being a way to do this with only 1 invocation of grep ... and is slick as hell (total nifty(1) fodder):

On Jan 5, 2012, at 12:07 PM, Jan Schaumann wrote:

> You want a [] in the grep to exclude the grep process itself.  You also
> want a \ to prevent termination of EOL:
> 
> ps aux | grep runawa[y] | \
> 	awk '{print $2 }' | xargs kill -30

this seems to work for everything except

ps aux | grep "gre[p]"


More information about the talk mailing list