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
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
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.
Summary: Shell Scripting -- Variables In the main script i have exported the variable and accessing it in another file but when i echo the value the value of the exported variable is not viewable . below are ...
Summary: Hi, Im trying to set variables in awk script but does not work, I dont know what Im doint wrong, this is my script. #!/bin/sh snmp-cpu="`snmpwalk -v 1 -c public -Oqv 10.10.1.1 1.3.6.1.4.1.9.2.1.58.0`...