question about setenv



Working with Oracle 9.2 on Solaris 5.9, I ran into some questions about
setenv (Disclaimer: I'm a DBA, not an SA).

Product has a tool that produces a set to .sh an .sql scripts which are
used to create a new database. The produced script that drives the
process (call it mysid.sh). To demonstrate and reproduce my problem, I
have reduced the script to this:

#!/bin/sh
-set x
setenv ORACLE_SID mysid


When running the script, the setenv line returns "setenv: not found"

So I do a find on setenv, locate the directory it is in and add it to
my path. Then the command returns:

$> edstest.sh
+ setenv ORACLE_SID mysid
cp: cannot create /usr/estevens/pref/.environ: No such file or
directory
cp: cannot create /usr/estevens/pref/.environ: No such file or
directory
$>

ok, there is no directory /usr/estevens/pref but why is setenv trying
to write a file at all? And why would it try to write that file to a
directory that is not guaranteed to be there? In the above example, my
$HOME directory is /usr/estevens, but it cant' be assumed that there
will necessarily be a $HOME/pref.

Enquiring minds want to know. For my purposes I can get around this my
inserting

ORACLE_SID=mysid
export ORACLE_SID

but would like to further my knowledge of Unix.

(Another anomoly, which I need to pose to the vendor (Oracle) is that
it appears from the man page that setenv is for csh, but not sh, yet
they gen a script which specifically runs sh and calls setenv.)

Thanks.

.



Relevant Pages

  • Re: question about setenv
    ... When running the script, the setenv line returns "setenv: ... setenv is a C-Shell builtin, ... If you put environment variables in a C-Shell script, ...
    (comp.unix.shell)
  • Re: [SLE] bash script for environment variables
    ... Ken Schneider wrote: ... setenv ISC_PASSWORD 999ans ... equivalent which can be called from a script? ...
    (SuSE)
  • Re: Verified for Spam -RODIN- I2R: Problem Accessing Perl Modules Through .htaccess
    ... may need to set the "SetEnv" direction in the httpd.conf. ... By the way,why don't include this line in your CGI script? ... But I have set .htaccess to contain this: ... the correct path: ...
    (perl.beginners)
  • Re: question about setenv
    ... So have you read documentation about the setenv ... It was something found in a script generated by a major, ... does document that 'setenv' is native to some shells, ...
    (comp.unix.shell)
  • Re: question about setenv
    ... setenv ... Product has a tool that produces a set to .sh an .sql scripts which are ... The produced script that drives the ... setenv is a csh command. ...
    (comp.unix.shell)