Create a new system variable

Satish Balay balay at fastmail.fm
Thu Apr 8 19:56:37 UTC 2004


> 
> Matthew Benjamin said:
> > Can someone tell me how to create a system variable. For instance I 
> > would like to create a variable called http_proxy that will be 
> > available for a cronjob. This requires the variable to be available to
> 
> > the process when no one is logged in. Export does not work because it 
> > disappears when you log off. editing the /etc/profile file to include 
> > this does not work because the variable is created as an environment 
> > variable and only exits while you're logged on. That's my dilemma. 
> > Please help.

Is the value static? if so, just define the variable in the crontab
file. And you can change to shell used by the crontab file - it it
makes things easier. I believe the default shell is /bin/sh - which
should source ~/.bashrc - when starting up any cronjobs.

For eg:

-------
ARG   = arg1 arg2 arg2
SHELL = /bin/tcsh
ENV_VARIABLE_USED_BY_MY_SCRIPT = val

1    0 * * * /home/foobar/script ${ARG}

-------

Satish





More information about the fedora-list mailing list