On Fri, May 02, 2025 at 12:19:52 +0700, Max Nikulin wrote: > I suggest to inspect PATH for each parent process PID in the tree reported > by > > ps xwf > > e.g. with proper PID number (single line) > > while IFS='' read -r -d ''; do if [[ "$REPLY" = PATH* ]]; then echo > "$REPLY"; break; fi; done </proc/PID/environ
FYI you could also use: grep -z ^PATH= /proc/PID/environ | tr \\0 \\n Or leave off the |tr if you don't mind having the result squashed together with the next shell prompt. Or replace |tr with ;echo to add a newline.