6 ms·
Is /proc as portable as `ps`?
by fizzled 6y ago
Is /proc as portable as `ps`?
- hibbelig 6y agoI guess that Linux `/proc` is different from Plan 9 `/proc`, and Linux `ps` is different from Plan 9 `ps`. So maybe yes.
- JdeBP 6y agoThere's a long explanation when it comes to ps, but the very short answer is twofold: * Don't parse the output of ps, unless it is my ps command (or plan 9's one, as here). See https://unix.stackexchange.com/a/593198/5132 https://unix.stackexchange.com/a/593198/5132 and https://unix.stackexchange.com/a/578816/5132 https://unix.stackexchange.com/a/578816/5132 , and their further reading, especially Greg Wooledge's article. * /proc is as portable as ps, but that doesn't really amount to much because neither is really portable at all. Pretty much every operating system's /proc is different; and no implementation of the ps command fully conforms to even the limited subset laid out in the Single Unix Specification.