From: | Andrew Udvare <audvare@×××××.com> | ||
---|---|---|---|
To: | Gentoo Users <gentoo-user@l.g.o> | ||
Subject: | Re: [gentoo-user] HOWTO: Freezing/unfreezing (groups of) processes | ||
Date: | Fri, 05 Feb 2021 08:46:55 | ||
Message-Id: | AA56AA93-4428-49FD-A77B-96633CB8867D@gmail.com | ||
In Reply to: | [gentoo-user] HOWTO: Freezing/unfreezing (groups of) processes by Walter Dnes |
1 | > On 2021-02-05, at 02:45, Walter Dnes <waltdnes@××××××××.org> wrote: |
2 | > |
3 | > done < /dev/shm/temp.txt |
4 | |
5 | You don't need to write a temporary file. You can pipe this directly into the while loop: |
6 | |
7 | while read |
8 | do |
9 | ... |
10 | done < <(ps -ef | grep ${1} | grep -v "grep ${1}" | grep -v pstop) |
11 | |
12 | Also to avoid the second grep in Bash at least: |
13 | |
14 | grep "[${1:0:1}]${1:1}" |
15 | |
16 | $ ps -ef | grep '[l]vmetad' |
17 | root 965 1 0 Jan31 ? 00:00:00 /sbin/lvmetad -f |
18 | |
19 | ^ No grep in output. |
20 | |
21 | -- |
22 | Andrew |
Subject | Author |
---|---|
Re: [gentoo-user] HOWTO: Freezing/unfreezing (groups of) processes | Walter Dnes <waltdnes@××××××××.org> |