[SunHELP] (no subject)

Eric LeBlanc inouk at toutatis.igt.net
Wed Apr 3 10:52:54 CST 2002


On Wed, 3 Apr 2002, Luis Palacios Palomino wrote:

> Hi sun Guru's
> 
> I have a perl script that use the DBI perl module to connect to a Oracle db.
> When a run the script in the line command, I have no problems, but when I
> put this in the crontab I get this error:
> 
> ORACLE_HOME environment variable not set!
> 
> I have set this variable in the /home_user/.profile, in /etc/profile, in
> /etc/default/cron, even I have declare this variable into the script but
> nothing seems to work.
> 
> more /etc/default/cron
> CRONLOG=YES
> ORACLE_HOME=/some_path/8i

Seem to be OK.

> 
> more /home_user/.profile
> ...
> export ORACLE_HOME=/some_path/8i
> ...

No, the best thing is:

ORACLE_HOME=/some_path/8i
export ORACLE_HOME

I don't know if you use bash or sh.  But, sh is, in many systems, the
default shell, and it does'nt support the export line, you must put into 2
lines, the definition of variable and export.



> 
> more /etc/profile
> ...
> ORACLE_HOME=/some_path/8i
> export ORACLE_HOME
> ...
> 


Seem to be OK


> more perl_script.pl
> ...
> my $ORACLE_HOME = "/some_path/8i";
> `export $ORACLE_HOME`;
> ...

that thing works ??  I alway thinking the export is a built-in command
from bash / sh, and cannot be called by perl.

Anyway, if it is does, you are trying to export "/some_path/8i" without
name of environment variable.

Try it:

my $ORACLE_HOME = "ORACLE_HOME=/some_path/8i"
...
`export $ORACLE_HOME`


Eric



More information about the SunHELP mailing list