4 ms·
I prefer this, which is shorter than both of those: xargs -0n1 < /proc/$pid/environ
by teddyh 10y ago
I prefer this, which is shorter than both of those:
xargs -0n1 < /proc/$pid/environ
- EvilTerran 10y agoOh, nice! I always forget that xargs defaults to echoing the parameters if you don't specify a command. That said, variations on my one are also handy for doing any further processing on the lines - eg, I do stuff like this pretty regularly: perl -ln0e '/^FOO=/&&print' /proc/$pid/environ