in reply to Environement variable help
As insensate said, $ENV{TESTVAR} = $date will do the trick if you want to use the environment variable within your script, or inherit it to the script's children.
It will not propagate back to the script's caller however. If that's the goal, then the solution is to simply backtick the Perl script - assuming you call it from a shell script and it is called "datescript", TESTVAR=`datescript` would do the trick. Although in that case, you better use date(1) rather than write a custom script - TESTVAR=`date '+%m%d%H%M'`.Makeshifts last the longest.
|
|---|