- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Problem in changing my environment variables.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 09:58 PM
04-09-2002 09:58 PM
Problem in changing my environment variables.
"oracle" I need to change some current environment variables, for examle
$ORACLE_HOME. I wrote the script with the strings like that:
export ORACLE_HOME=/oracle9ias ;
echo $ORACLE_HOME;
etc.
But after the finish of the script all environment variables stay the same.
What should I do?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 10:07 PM
04-09-2002 10:07 PM
Re: Problem in changing my environment variables.
if you just create a script and execute it, it will spawn a new shell, sets the variables for this shell and maybe it subshells. But if the script terminates the shell will be closed and the variable settings are gone.
To set the variables in your current shell, you have to "source" the script:
# . ./script.sh
will source the script into your bourne or korn shell.
Heiner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 10:08 PM
04-09-2002 10:08 PM
Re: Problem in changing my environment variables.
When you run a script it always forks and thus only higher levels get the values.
To change your local values run as
. script
The decimal point space script inhibits the fork and changes values of your current shell.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 10:08 PM
04-09-2002 10:08 PM
Re: Problem in changing my environment variables.
Hi,
A modification of an environment-variable
has effect for the current-process and
children of this.
It does not change the value of the same
environment-variable for the parent process.
Regards
olav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 10:14 PM
04-09-2002 10:14 PM
Re: Problem in changing my environment variables.
Always use a environment sourcing file to source in your environment variables...
Put all your environment variables that you need in a file:
ORACLE_HOME=/apps/oracle
LD_LIBRARY_PATH=/....
etc...
call it oracenv ...
set an alias in your .profile or .alias_profile
alias appora='. /path/to/the/oracenvfile'
After you login as oracle ... just type
appora
at the command prompt, this will source-in all the env variables that you need..
Hope this helps !
Thanks,
Shabu