Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××.net>
To: gentoo-user@l.g.o
Subject: Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted
Date: Fri, 23 Aug 2019 22:05:19
Message-Id: 471B235F-5219-4F03-9542-494FFCC883B1@stfw.net
In Reply to: Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted by Andrew Udvare
1 On 22 August 2019 22:08:41 GMT-04:00, Andrew Udvare <audvare@×××××.com> wrote:
2 >
3 >> On 2019-08-22, at 12:31, Laurence Perkins <lperkins@×××××××.net>
4 >wrote:
5 >>
6 >> A common tactic is to use grep twice:
7 >> ps auxf | grep -v grep | grep blah
8 >
9 >Or grep with brackets:
10 >
11 >ps aux | grep '[f]irefox'
12 >
13 >I have a function for this:
14 >
15 >psgrep() {
16 > ps aux | grep "[${1:0:1}]${1:1}";
17 >}
18 >
19 >This works because the ps output will have "grep [f]irefox" and the
20 >regex can't match that line (without escaping the [] again).
21
22 Or just use pgrep, I usually use pgrep - fa.
23 --
24 Sent from my Android device with K-9 Mail. Please excuse my brevity.

Replies

Subject Author
Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted james <garftd@×××××××.net>