Is there no section of Mac OS X on Tek-Tips? There is a server version. Does it not make the grade to be in this section of TTs? Looked. Didn't see one. Anyway, here goes.
On Mac OS X, for a given process ID, what is the best/most direct way to determine the environment variables (e.g. PATH)? Must be able to query for any arbitrary environment variable. PATH is just the first example.
'lsof -a -p $PID -d cwd -F' gets some of it.
But, I don't see a way to get the PATH for the given PID, using lsof.
'ps -Ep $PID' gets some of it.
But, again, 'not comprehensive. It appears to give back only a portion of the 'environment' for the process.
On a number of other Linux/UNIX variants, you can look at '/proc//environ'. But, OS X apparently does not use that mechanism.
'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
On Mac OS X, for a given process ID, what is the best/most direct way to determine the environment variables (e.g. PATH)? Must be able to query for any arbitrary environment variable. PATH is just the first example.
'lsof -a -p $PID -d cwd -F' gets some of it.
But, I don't see a way to get the PATH for the given PID, using lsof.
'ps -Ep $PID' gets some of it.
But, again, 'not comprehensive. It appears to give back only a portion of the 'environment' for the process.
On a number of other Linux/UNIX variants, you can look at '/proc//environ'. But, OS X apparently does not use that mechanism.
'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.