public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-user] HOWTO: Freezing/unfreezing (groups of) processes
  @ 2021-02-05  8:46 99% ` Andrew Udvare
  0 siblings, 0 replies; 1+ results
From: Andrew Udvare @ 2021-02-05  8:46 UTC (permalink / raw
  To: Gentoo Users


> On 2021-02-05, at 02:45, Walter Dnes <waltdnes@waltdnes.org> wrote:
> 
> done < /dev/shm/temp.txt

You don't need to write a temporary file. You can pipe this directly into the while loop:

while read
do
...
done < <(ps -ef | grep ${1} | grep -v "grep ${1}" | grep -v pstop)

Also to avoid the second grep in Bash at least:

grep "[${1:0:1}]${1:1}"

 $ ps -ef | grep '[l]vmetad'
root         965       1  0 Jan31 ?        00:00:00 /sbin/lvmetad -f

^ No grep in output.

--
Andrew

^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-02-05  7:45     [gentoo-user] HOWTO: Freezing/unfreezing (groups of) processes Walter Dnes
2021-02-05  8:46 99% ` Andrew Udvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox