Closed lumikalt closed 2 years ago
Yes trying updating to latest version of pgrep
I'm running the latest, still shows no -m flag support...
Indeed. Procps-ng pgrep
(1) doesn't have the -m
flag, which most Linux distributions use. So, I was wondering which version of pgrep
it's ..
The man-page says it's from 2020-06-04, don't know if that's when it was created or last updated
I guess the -m
flag is like GNU grep
--max-count
flag (?)
https://github.com/Mangeshrex/rxfetch/blob/3960865a001c82e3321f0fcc1583787b3e9953d3/rxfetch#L185
-m NUM, --max-count=NUM
Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the
standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines. This enables a calling
process to resume a search. When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep
does not output a count greater than NUM. When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines.
If your distro uses procps-ng, simply remove the -m 1
flag. It should only show one process.
i see, ty
Is the issue fixed @lumi-kalt ?
Indeed. Tho I'm unsure if you can test pgrep's availability of the -m flag for everyone…
I suggest to use ps -e | grep -m1 -Fo
instead.
https://github.com/Mangeshrex/rxfetch/blob/3960865a001c82e3321f0fcc1583787b3e9953d3/rxfetch#L185
Indeed, grep should work the same on all machines.
In the script step where it checks for the dw/wm, calling pgrep-m errors, as it does not appear to be a valid flag. Instead, it prints the usage help for pgrep. Maybe I need another version?
Using fish on kitty, in EndeavourOS.