On Fri, 4 Nov 2022 at 12:09, Christoph Anton Mitterer <cales...@scientia.org>
wrote:

>         pgrep --full --exact --euid "${LOGNAME}" --list-full -- "^ssh:
> ${HOME}/\.ssh/mux/.+ \[mux]$"
>
$ ./blah [4565] &
[1] 769
$ pgrep --full --exact --list-full '^/bin/sh ./blah \[4565]$'
769 /bin/sh ./blah [4565]
$ cat blah
#!/bin/sh
sleep 100

I'm was also pretty sure that this script used to work (but no longer does
> now),
> but I've tested on some ancient Debian, and even there it fails.
>
 I'm not sure why it is not matching, my test script above works fine. That
was with 3.3.17-5

The reason seems to be, that there are trailing 0x00.
>
That's how the argument list is stored. libproc parses it out into a set of
strings or one long string.

You can't really directly use grep because the library is parsing it, while
grep uses the raw input.

 - Craig

Reply via email to