[PLUG] Environment variable for a program

Will Andrews Will Andrews <will@physics.purdue.edu>
Wed, 3 Oct 2001 12:27:35 -0500


On Wed, Oct 03, 2001 at 12:18:15PM -0500, Doug Meyer wrote:
> I have a little program which is supposed to run in my crontab once a
> day.  This program needs to have an environment variable set so it knows
> the path to a program to restart daily.
> 
> However, I am having problems setting this variable so that the program
> can deal with it.  I have tried running both
> export VARIABLE=argument
> 
> and
> 
> VARIABLE=argument
>  in the crontab in the line just before the program runs that needs it.
> But for some reason the global environment variable is not getting set,
> but when I run export VARIABLE=argument from my command shell, and then
> run the program manually instead of from the crontab, it sets it just
> fine and the program is able to get the variable it needs.
> 
> I hope this makes sense...I need to know how to make the environment
> variable so it is ALWAYS set, regardless of whether I am logged in or
> not...

For crontab, use env(1).

-- 
wca