Computing.Net > Forums > Unix > Variables in .profile

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Variables in .profile

Reply to Message Icon

Name: pbekal
Date: April 8, 2004 at 13:22:56 Pacific
OS: HPUX
CPU/Ram: 8cpu
Comment:

I have PS1='$NODE [$ORACLE_SID]> '
Everytime the $ORACLE_SID changes the Unix Prompt (PS1) value changes.
--
Similarly I want to set my own variable
P=/opt/oracle/$ORACLE_SID

Everytime the $ORACLE_SID changes the value of P should change. But it does not change and remains the same.

How can I set the variable P so that the value of the variable P changes based on the $ORACLE_SID



Sponsored Link
Ads by Google

Response Number 1
Name: WilliamRobertson
Date: April 8, 2004 at 15:43:09 Pacific
Reply:

PS1 is evaluated each time the shell writes a new prompt line. I'm not sure what you mean by ORACLE_SID changing. Do you have a common .profile across multiple servers, and want a session variable to reflect the setup on each machine when you log into it?


0

Response Number 2
Name: pbekal
Date: April 9, 2004 at 06:28:21 Pacific
Reply:

I want to setup my own variable P which is evaluated each time the shell writes a new prompt line just like PS1.
For example.

# definition in .profile
PS1='[$ORACLE_SID]> '
export P=/opt/$ORACLE_SID

if value of $ORACLE_SID=AERP then
value of PS1= [AERP] >
value of P=/opt/AERP

When I change ORACLE_SID=XXXX on the command line.
value of PS1= [XXXX] >
But value of P=/opt/AERP
I want the value of P to change to /opt/XXXX

I want the variable P to be evaluated each time the shell writes a new prompt.

Thanks


0

Response Number 3
Name: WilliamRobertson
Date: April 9, 2004 at 17:26:44 Pacific
Reply:

There is no mechanism to do that, AFAIK.

I'm not getting why ORACLE_SID would change, though.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Output redirecting!! sco disk copy



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Variables in .profile

Variables in Shell SCripting www.computing.net/answers/unix/variables-in-shell-scripting/6020.html

awk variables in shell script www.computing.net/answers/unix/awk-variables-in-shell-script/6201.html

variables in unix www.computing.net/answers/unix/variables-in-unix/5573.html