Operating System - HP-UX
1752788 Members
6168 Online
108789 Solutions
New Discussion юеВ

Re: ksh: @: parameter not set

 
SOLVED
Go to solution
James R. Ferguson
Acclaimed Contributor
Solution

Re: ksh: @: parameter not set

Hi:

> Not sure of where the set is supposed to go.

Save a copy of the original 'oraenv' script and then add 'set +u'

...on a new line immediately after the interpreter line so the script looks like:

#!/bin/sh
set +u

Now try running it again.

Regards!

...JRF...
wayne_104
Regular Advisor

Re: ksh: @: parameter not set

Thank you so much that has worked my DBA is now embarassed as I have told him it is actually an oracle problem and not os.

THANK YOU.
James R. Ferguson
Acclaimed Contributor

Re: ksh: @: parameter not set

Hi (again):

Wait. The script should be running the HP_UX POSIX shell since '/bin/sh' should be a link to '/usr/bin/sh'.

Your error report indicates that the Korn ('ksh') shell is running. That tells me that your default shell for your 'oracle' account is 'ksh', *and* in fact you wrongly did:

$ . oraenv

...instead of:

$ ./oraenv

In the first case you simply "sourced" (read) the file into your current shell environment. You need to actually *execute* it as shown in the second line above.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: ksh: @: parameter not set

>JRF: *and* in fact you wrongly did:
$ . oraenv

Why do you think that? The script fragment says it sets up the the environment.
(Remember I suggested you not have "#!" at the start of sourced files. ;-)

>You need to actually *execute* it as shown in the second line above.

That's NOT what the documentation says. Wayne followed directions.
wayne_104
Regular Advisor

Re: ksh: @: parameter not set

set +u in the oreenv solved the problem
James R. Ferguson
Acclaimed Contributor

Re: ksh: @: parameter not set

Hi:

@ Dennis: Why do you think that? The script fragment says it sets up the the environment. (Remember I suggested you not have "#!" at the start of sourced files. ;-)

Oops [egg on face]. I just scanned the code and went right by the documentation :-(

Ad for our discussion (elsewhere) of using or not using an interpreter line in sourced files, I now see why you suggest *not* to do so. I'm changing my thinking :-)

Regards!

...JRF...
Alan S Martin
New Member

Re: ksh: @: parameter not set

Yes "set +u" avoids the error, but it is a band-aid. You must always source ". oraenv" the program or the variables set will not be available to your foreground shell. There are many side effects to sourcing oraenv with command arguments:

1) The "#!/bin/sh" at the top is ignored.
2) $@ (no set +u) errors as it is null until the first use of a supplied argument.
3) Once an argument is specified to oraenv, $@ retains that value, even if you call oraenv again without arguments!!!

Note oraenv works on Sun Sparc without modification. I have an SR open with Oracle support to use an env variable instead of cmd line arguments.

Regards,
Alan