Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

%ENV variables not picked up when run from crontab

Status
Not open for further replies.

adrian1970

Technical User
Joined
Oct 23, 2006
Messages
2
Location
GB
Hi,

when using the predefined hash %ENV some variables are not found if the script is run from a crontab.

$HOME = $ENV{'HOME'};

works fine, but;

$user = $ENV{'USER'};

produces no result.

why is that?

thanks,
Ad

 
found a solution to my problem anyway, use:

$user = $ENV{'LOGNAME'};

this still works when scripts is called a crontab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top