2 ms·
Again, though, viraptor was talking about the APIs used in C programming, not what one has in shell script programming. When it comes to shell script programmi
by JdeBP 6y ago
Again, though, viraptor was talking about the APIs used in C programming, not what one has in shell script programming.
When it comes to shell script programming, the obvious mechanism has already existed in FreeBSD for quite a while now. It's vis (vis(1), unvis(1), vis(3)). I have an alternative to ps that vis-encodes the fields in its output, and from experience most and possibly all of the well-known and widely-documented (by Greg Wooledge and others) pitfalls that are warned about do indeed go away with simple application of vis encoding.
It does the same on Linux-based operating systems, too, although one has to go and get an unvis tool from somewhere. Yes, the code to read the process table on Linux in the first place does indeed involve decoding human-readable strings from stat files into machine form. (-:
* https://unix.stackexchange.com/a/593198/5132 https://unix.stackexchange.com/a/593198/5132