in reply to Re: Access system ENV variables from within CGI Script
in thread Access system ENV variables from within CGI Script

Thanks for the link, I am using this code, tillys updated function actually. The shell we are using is ksh. Within the .profile I see many variables which are exported, but sadly do not get printed (using Data::Dumper) when I am testing my script with the tillys function. Any suggestions would be great. TIA
  • Comment on Re^2: Access system ENV variables from within CGI Script

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

    You will need to debug the output from the `env` command then. Compare what the script outputs when it is run from your shell account. Compare what `env` returns when run from your shell account to the output from the CGI. Take out all intermediaries. Eliminate all differences. Find out where the two scripts/environments differ.

    Most likely, from your .profile something else gets run. Maybe only if there is a terminal connected. It's hard to tell without seeing your code and the relevant parts of the .profile.

      I notice the function calls `echo env |...`, when I do echo env from the command line I get nothing, env by iteself works. An example of a line from the .profile is: TESTUSERS="test@unix.company.com"; export TESTUSERS. This is one of the variables that tillys method does not pick up. Thanks again for your help