in reply to Access system ENV variables from within CGI Script

a cgi script runs as wwwrun or www or whatever. Which is why it can't get at a "user" .profile.

From my understanding the .profile was a config file that isn't loaded until you launch a terminal session and unloaded on close. Usually the profile.local is the global profile.

Perhaps the better question is what you are trying to glean from the file that might be gleaned thur another way.
  • Comment on Re: Access system ENV variables from within CGI Script

Replies are listed 'Best First'.
Re^2: Access system ENV variables from within CGI Script
by Corion (Patriarch) on Oct 12, 2007 at 14:14 UTC

    A .profile file is not a "config file". It is an executable program which is run by a shell language interpreter. The only way to faithfully reproduce arbitrary settings made via executing a .profile shell program is by running that shell program or by writing a shell program interpreter. Of course, simple settings can be extracted via crafty regular expressions.

      wow I always thought that /etc/profile.d was the exe and that when run by the terminal loaded/ran the .profile.