3 ms·
Does that work on anything other than Linux?
by protomyth 12y ago
Does that work on anything other than Linux?
- myhf 12y agoNot in exactly the same way, but every unixy system has some way of finding the parent pid and looking up its command line.
- protomyth 12y agoIs Quanticles's code portable to the other unix systems?
- myhf 12y agoIt should work on most systems that have a /proc filesystem: http://en.wikipedia.org/wiki/Procfs http://en.wikipedia.org/wiki/Procfs If you don't have /proc but do have ps (1), you could get the parent pid like this: PID := $(ps -p $$$$ -o ppid=)