From: | Andrew Udvare <audvare@×××××.com> | ||
---|---|---|---|
To: | gentoo-user@l.g.o | ||
Subject: | Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted | ||
Date: | Fri, 23 Aug 2019 02:08:52 | ||
Message-Id: | A87D2EF2-0BF5-469D-92C3-EEFF5DCBA3EF@gmail.com | ||
In Reply to: | Re: [EXTERNAL] Re: [gentoo-user] empty cdrom drive is busy or mounted by Laurence Perkins |
1 | > On 2019-08-22, at 12:31, Laurence Perkins <lperkins@×××××××.net> wrote: |
2 | > |
3 | > A common tactic is to use grep twice: |
4 | > ps auxf | grep -v grep | grep blah |
5 | |
6 | Or grep with brackets: |
7 | |
8 | ps aux | grep '[f]irefox' |
9 | |
10 | I have a function for this: |
11 | |
12 | psgrep() { |
13 | ps aux | grep "[${1:0:1}]${1:1}"; |
14 | } |
15 | |
16 | This works because the ps output will have "grep [f]irefox" and the regex can't match that line (without escaping the [] again). |
17 | |
18 | |
19 | -- |
20 | Andrew |
Subject | Author |
---|---|
Re: [EXTERNAL] [gentoo-user] empty cdrom drive is busy or mounted | Neil Bothwick <neil@××××.net> |