You don’t need a script. A one liner easily does the trick.
perl -e 'printf("%25s --> %s\n", $_, $ENV{$_}) for keys %ENV'
All those variables are available to the scripts started from the a shell; depending on the actual user and process running the script. You probably have a built-in env command too if that’s all you need. Try man env.
[close]
Permanent link · http://querylog.com/q/env+perl+shell+script