I have tried solving this problem long time ago. I gave up because crond
seems to have a mind of its own and not following even its own man pages.
My solution was to embed the variable in the script itself or put that
variable in a file that the script can read.

rowel

On Tue, 12 Nov 2002, Glynn S. Condez wrote:

> From: "Ronald Warner" <[EMAIL PROTECTED]>
>
> > i have created a script that checks other servers and depending on whether
> > they are up, it would change the default gw.  anyway, i am planning on
> > adding this to crond.  when it ran, it said:
> > /root/scripts/gwchk: [: =: unary operator expected
> > /root/scripts/gwchk: [: =: unary operator expected
>
> > in /etc/rc.d/rc.local, i have set the following GW=gateway1.  in the
> script,
> > i have a "if [ $GW = 'gateway1' ]; then"  it seems that the variable i
> have
> > set at startup does not seem to get carried "globally."  anyone know how i
> > can set a variable up for global use?
>
> Have you tried exporting the variables?
> ex: export GW="gateway1" and calling that variable like $GW
>

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to