Simple code in Perl to list the environment variables in Unix.
#!/usr/bin/perl5
foreach $env_key (keys %ENV)
{
print "ENV{$env_key} = $ENV{$env_key}\n";
}
Explanation :
The %ENV stores the list of environment variables in the Unix system.
The above code takes the values and stores it in $env_key and simply displays it
Paid for writing
In case you like my writing and would like me to write for your website, then please leave a comment to any of my blog article, mentioning your Email Id and I will reply back. Thanks
Tuesday, January 20, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment