ps.sh: fix ps arguments to work for busybox

Use the format specifier 'ppid,args' instead of 'ppid command'. POSIX
allows either spaces or commas as separators, but busybox only allows
commas. Furthermore, 'args' is recognized by POSIX[0] while 'command' is
not. On implementations of ps that do recognize 'command', it is simply
an alias for 'args', e.g. Debian[1] and FreeBSD[2].

[0]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
[1]: https://manpages.debian.org/bullseye/procps/ps.1.en.html
[2]: https://www.freebsd.org/cgi/man.cgi?query=ps
This commit is contained in:
Thomas Faughnan 2022-09-20 18:30:28 -04:00
parent 75458f91c8
commit 45aa8feef6
No known key found for this signature in database
GPG Key ID: 1FDE884E5506AA58
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ exit_safely_if_empty_ppid() {
}
full_command() {
ps -ao "ppid command" |
ps -ao "ppid,args" |
sed "s/^ *//" |
grep "^${PANE_PID}" |
cut -d' ' -f2-