0

Hi All

Im very new to perl scripting coming from a shell background, but im determine to stick to it and learn perl.

I have env variables which i have defined in my perl script and work fine from command line as these env variables are in my profile. When i get cron to run the script i dont believe these variables are being used and causing my script to not pull back data.

[
#!/usr/bin/perl -w
#
#
use strict;

$ENV{'AUTOSYS'} = "/opt/autosys/P22";
$ENV{'AUTOSERV'} = "P22";
$ENV{'AUTOTREE'} = "/opt/autosys";
$ENV{'AUTOUSER'} = "/opt/autosys/P22/autouser";
]

Any guidance or help would be most appreciated.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by skelly16
0

Hi,
is your cron job created for the same usr as you use to run the script? If yes, in my opinion, the env variables should get assigned with new values. Also note that these env variables you set in the script will be available till executing script ends.

katharnakh.

0

Hi,
is your cron job created for the same usr as you use to run the script? If yes, in my opinion, the env variables should get assigned with new values. Also note that these env variables you set in the script will be available till executing script ends.

katharnakh.

Hi i created a cron entry for my id so it is the same user. Still dont know why this env variables dont get involved in the script.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.