Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted

2019-08-23 Thread james
On 8/23/19 5:21 PM, Neil Bothwick wrote:
> On 22 August 2019 22:08:41 GMT-04:00, Andrew Udvare  wrote:
>>
>>> On 2019-08-22, at 12:31, Laurence Perkins 
>> 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).
> 
> Or just use pgrep, I usually use pgrep - fa. 
> 

Ah, that is what I was looking for

thx,
James



Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted

2019-08-23 Thread Neil Bothwick
On 22 August 2019 22:08:41 GMT-04:00, Andrew Udvare  wrote:
>
>> On 2019-08-22, at 12:31, Laurence Perkins 
>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).

Or just use pgrep, I usually use pgrep - fa. 
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted

2019-08-22 Thread Andrew Udvare


> On 2019-08-22, at 12:31, Laurence Perkins  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