Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have to use Perl in a "cron" job.
However, my environmental variables seem not to export to Perl (but they do seem to export to csh.) Running the following "cron" job:
What is the recommended "fix" for this problem?
However, my environmental variables seem not to export to Perl (but they do seem to export to csh.) Running the following "cron" job:
/usr/bin/csh -c printenv
Produces the correct set of environmental variables.
However, the Perl script "cron" job:
/home/username/bin/perlprintenv.pl
where the code is simply:
produces a much shorter list of variables and a shorter path. I am running Solaris.#!/usr/local/perl -w foreach $c (keys %ENV) { print "$c \t".$ENV{$c}."\n"; }
What is the recommended "fix" for this problem?
Is there any easy way to force cron to export all variables?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl & cron job environmental variables
by Fletch (Bishop) on Jul 02, 2007 at 20:26 UTC | |
Re: Perl & cron job environmental variables
by toolic (Bishop) on Jul 02, 2007 at 20:49 UTC | |
Re: Perl & cron job environmental variables
by dorko (Prior) on Jul 02, 2007 at 20:29 UTC | |
Re: Perl & cron job environmental variables
by djp (Hermit) on Jul 03, 2007 at 03:33 UTC | |
Re: Perl & cron job environmental variables
by Anonymous Monk on Jul 03, 2007 at 01:29 UTC | |
Re: Perl & cron job environmental variables
by Anonymous Monk on Jul 02, 2007 at 20:20 UTC |
Back to
Seekers of Perl Wisdom