General
cancel
Showing results for 
Search instead for 
Did you mean: 

permanent bourne shell environment change

SOLVED
Go to solution
Travel Mug
Frequent Advisor

permanent bourne shell environment change

I am trying to set an environmental value for my java runtime environment on HPUX 11.23 in order to support an upgrade of Data Protector from 6.0 to 6.1. In my data space, I enter:
export DP_JAVA_DIR=/opt/java1.5/jre/

And this works: I see it when I type:
env
And DP6.1 starts up without displaying the "your JRE version is wrong" message that I was getting *before* performing the export.
But, after I shut down the DP6.1 GUI and the data space where I performed the export, the environment reverts back to the state it was in before I performed the export. In other words, it loses the pointer to java.

How do I get the java pointer in the environment so that it stays there even after I shut down the data space?
6 REPLIES
Dennis Handly
Acclaimed Contributor

Re: permanent bourne shell environment change

There are no bourne shells here, just posix or ksh.

You can put that export in your .profile.
Is there some configuration file for DP where you can add it?
TwoProc
Honored Contributor

Re: permanent bourne shell environment change

Dear Mug,

just add that line to the .profile of login that is running xomni. Or, if that would cause problems with other programs - just write a script file that runs xomni for you, and in THAT script add the export.

----------suggested script below---------
#!/bin/ksh
export DP_JAVA_DIR=/opt/java1.5/jre/
/opt/omni/bin/xomni
------------------------------------

Now save that script as DP6,
and do a "chmod u+x" on the file to make it executable. Then put it in the path for your user, or add a directory to your path and put it in there, like /home/TMug/bin
and put your script in there. So, anytime you type "DP6" it will kick off your export and then run your omniback (ne' data protector) interface.

Hope that helps.
We are the people our parents warned us about --Jimmy Buffett
Travel Mug
Frequent Advisor

Re: permanent bourne shell environment change

Dennis - I am new to HP-UX, so thakns for that tidbit about the shells. There is no config file in DP. Putting the export command in my .profile did not solve the problem (in fact, for reasons unknown to me, the statement in my .profile failed to set the value into the environment).

TwoProc - You said "Then put it in the path for your user, or add a directory to your path". I assume you refer to the path as shown in the environment. This is the problem => I don't know how to do that. I think maybe that is what I should really be asking. How do I add the new path to the "PATH=" in the environment?
Steven Schweda
Honored Contributor
Solution

Re: permanent bourne shell environment change

> Putting the export command in my .profile
> did not solve the problem [...]

You also need to have the shell (re-)read
your "~/.profile" file, so log in again, or:
. ~/.profile

(Unless you're using a C shell, which doesn't
look at "~/.profile".)

Note that we can't see what's in your
"~/.profile", and we can't see exactly what
you're doing after you change it, all of
which makes it hard to say why things aren't
working as expected.

> How do I add the new path to the "PATH="
> in the environment?

Depending on exactly what you want:
PATH="new_dir:${PATH}"
or
PATH="${PATH}:new_dir"

Again, adding this to your "~/.profile" may
be useful, depending on what's in there
already.

ls -l ~/.profile
Travel Mug
Frequent Advisor

Re: permanent bourne shell environment change

That did the trick. I did not realize that there was a file out there called .PATH
I vi'd into it and added the path, then logged out and logged back in, and viola`. Also, just to play around and maybe learn something, I un-did my change to the .PATH file, logged out, back in, and issued the command:

PATH=$PATH:{path}

then logged out and back in, and same thing, only a lot easier, only I'm not certain that I actually needed to log out and back in at that point. At any rate, problem solved. Thanks to all.
Dennis Handly
Acclaimed Contributor

Re: permanent bourne shell environment change

>there was a file out there called .PATH

This must be specific to your system.

>I'm not certain that I actually needed to log out and back in

You can always source your .profile or execute the command in question.