1753905 Members
10146 Online
108810 Solutions
New Discussion юеВ

Re: setenv HP-UX 11i

 
SOLVED
Go to solution
mvr
Regular Advisor

setenv HP-UX 11i

Hello,

I need to set enviroment for a Vertex, tax calculating software, to be able to debug a problem.
However I can not find "setenv" on my unix 11i system.
I tried "whereis setenv", but did not find any ( maybe not in a path ). After searching for the command ( using "find" ) I found it in a /usr/lib/builtins directory.
The only way to execute it is by using ./ in front ( as a root user ).
My command look like this:

cd /usr/lib/builtins
./setenv VERTEXDEBUG 1

Command executed with no problem, but when I looked at the enviroment ( using "env" ), I did not see VERTEXDEBUG=1
Is this correct "setenv" command?

Miro
6 REPLIES 6
Murat SULUHAN
Honored Contributor
Solution

Re: setenv HP-UX 11i

Hi

Default shell is POSIX, so you should try

export VERTEXDEBUG=1

Best Regards
Murat
Murat Suluhan
Patrick Wallek
Honored Contributor

Re: setenv HP-UX 11i

What shell are you using?

echo $SHELL

If you are using sh or ksh then you need to use 'export' like:

export VERTEXDEBUG=1

If you are using csh then you use setenv.
James R. Ferguson
Acclaimed Contributor

Re: setenv HP-UX 11i

Hi:

To add:

If you wish to create a file of variables that you want to export to your environment, for example to use in other scripts, do something like this:

# cat myvars
export VERTEXDEBUG=1
export OWNER=miro

...now, when you need to reference these variables in your current environment, source (read) the 'myvars' file thusly:

# . myvars

...that's a dot followed by whitespace, followed by the filename. Do not simply execute the file as this causes it to run in a new, separate shell and childen can't change their parent's environment.

Regards!

...JRF...
mvr
Regular Advisor

Re: setenv HP-UX 11i

Thank you guys. The "export" command did a trick.
Jeeshan
Honored Contributor

Re: setenv HP-UX 11i

export VERTEXDEBUG=1
in command line will temorarily export the variables. when you logout it will gone.

if you want to make it permanent add an entry in .profile.
a warrior never quits
mvr
Regular Advisor

Re: setenv HP-UX 11i

Great point. Thanks.

Miro