> On 2019-08-22, at 12:31, Laurence Perkins <lperk...@openeye.net> wrote:
> 
> A common tactic is to use grep twice:
> ps auxf | grep -v grep | grep blah

Or grep with brackets:

ps aux | grep '[f]irefox'

I have a function for this:

psgrep() {
  ps aux | grep "[${1:0:1}]${1:1}";
}

This works because the ps output will have "grep [f]irefox" and the regex can't 
match that line (without escaping the [] again).


-- 
Andrew

Reply via email to