Re:Pipeable Ruby - forget about grep / sed / awk / wc ...
by smcdow on Thursday April 21, 2011 @10:59AM
(#2470840)
function psg () { [[ -z "$1" ]] && return ; local _first=${1:0:1} ; local _rest=${1:1} ; [[ -z "$_rest" ]] && _rest='[^]]' ; local _com="ps -ef | grep '[$_first]'$_rest" ; eval "$_com" }
Re:Pipeable Ruby - forget about grep / sed / awk / wc ...
by eik3_de on Friday April 22, 2011 @05:52AM
(#2473656)
My take: https://gist.github.com/936362
Re:Pipeable Ruby - forget about grep / sed / awk / wc ...
by Despite on Thursday April 21, 2011 @01:48PM
(#2471545)
Wow, that's certainly one way to do it. I'm still not seeing an issue with 'grep -v grep'.
Re:Pipeable Ruby - forget about grep / sed / awk / wc ...
by smcdow on Thursday April 21, 2011 @02:40PM
(#2471756)
ps -ef | grep foo | grep -v grep
Will fail if foo="grep"
Re:Pipeable Ruby - forget about grep / sed / awk / wc ...
by smcdow on Thursday April 21, 2011 @02:39PM
(#2471749)
Drop it in your .bashrc and just type "psg foo"
Re:Pipeable Ruby - forget about grep / sed / awk / wc ...
by devicenull on Friday April 22, 2011 @09:39AM
(#2473998)
Check out pgrep -f
And I almost always want the full ps output, or I'm searching for a commandline argument rather than the process name, so pgrep is out.