HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- looking for a simple way to organize envs on our u...
Operating System - HP-UX
1826474
Members
4002
Online
109692
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
08-25-2008 08:27 AM
08-25-2008 08:27 AM
would like to standardize how we set envs on our unix box, so I thought a menu would be a great way to accomplish this.
The problem I'm experiencing, is the value is set...but ONLY during the time the menu is initiated.
please see below:
> /home/is/bin/r12MENU.sh
**================================================================**
** to Set your environment, select one of the following: **
** 1.) DEVSID - Development Environments **
** 2.) UATSID - CRP2/UAT Environments **
** 3.) GLDSID - GOLD Environments **
** 4.) APPSSID - PROD Environments **
** e.) EXIT this menu **
**================================================================**
** Enter your response (1, 2, 3, 4 or [e]): 1
**=========================================================**
** You have chosen DEVSID - Development Environments **
** **
** your environment will now be set... **
**=========================================================**
devsid
the devsid you see above is an ECHO within the menu script on oracle_sid.
so I know it's setting the correct env, but only during the running of the menu-script.
If I perform an echo from command line...it's set to whatever was defined before running the menu.
If I run the individual scripts from CL, it sets my env correctly...so it's not the individual env scripts.
any assistance would be appreciated,
manny
The problem I'm experiencing, is the value is set...but ONLY during the time the menu is initiated.
please see below:
> /home/is/bin/r12MENU.sh
**================================================================**
** to Set your environment, select one of the following: **
** 1.) DEVSID - Development Environments **
** 2.) UATSID - CRP2/UAT Environments **
** 3.) GLDSID - GOLD Environments **
** 4.) APPSSID - PROD Environments **
** e.) EXIT this menu **
**================================================================**
** Enter your response (1, 2, 3, 4 or [e]): 1
**=========================================================**
** You have chosen DEVSID - Development Environments **
** **
** your environment will now be set... **
**=========================================================**
devsid
the devsid you see above is an ECHO within the menu script on oracle_sid.
so I know it's setting the correct env, but only during the running of the menu-script.
If I perform an echo from command line...it's set to whatever was defined before running the menu.
If I run the individual scripts from CL, it sets my env correctly...so it's not the individual env scripts.
any assistance would be appreciated,
manny
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2008 08:56 AM
08-25-2008 08:56 AM
Solution
"If I run the individual scripts from CL, it sets my env correctly...so it's not the individual env scripts." Doubtful. How are you "running" them?
As for the remainder of the problem:
that is the normal behaviour...you are altering the ENV of the child process, so the changes "disappear" when the child ends.
you need to "dot-in" (source) both the menu script AND the scripts run by the menu to change the environment.
ie:
. /home/is/bin/r12MENU.sh
and within r12MENU.sh each selected item must be "sourced" as well
Alternatively, one *might*, for each "selection":
a) Set environment
b) execute a "new" shell. Puts you in a sub-shell with the "correct" environment
c) exit the sub-shell, which should return you to the menu script.
Can't vouch for the later, as I've not tried it.
As for the remainder of the problem:
that is the normal behaviour...you are altering the ENV of the child process, so the changes "disappear" when the child ends.
you need to "dot-in" (source) both the menu script AND the scripts run by the menu to change the environment.
ie:
. /home/is/bin/r12MENU.sh
and within r12MENU.sh each selected item must be "sourced" as well
Alternatively, one *might*, for each "selection":
a) Set environment
b) execute a "new" shell. Puts you in a sub-shell with the "correct" environment
c) exit the sub-shell, which should return you to the menu script.
Can't vouch for the later, as I've not tried it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2008 09:36 AM
08-25-2008 09:36 AM
Re: looking for a simple way to organize envs on our unix box...
Shalom,
1) Figure out what is common to all environments.
2) Rather than have a menu required for login which can mess up the users if they want to automate some of their work, have a little script that pops up. User types myenv. Then the menu comes up and sources one of the 4 environment files. Set up a default or set a single variable for each user with the best guess for what they do. if [ "$USENV" == "dev" ] then . devenv
Something like that.
SEP
1) Figure out what is common to all environments.
2) Rather than have a menu required for login which can mess up the users if they want to automate some of their work, have a little script that pops up. User types myenv. Then the menu comes up and sources one of the 4 environment files. Set up a default or set a single variable for each user with the best guess for what they do. if [ "$USENV" == "dev" ] then . devenv
Something like that.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2008 10:25 AM
08-25-2008 10:25 AM
Re: looking for a simple way to organize envs on our unix box...
referencing the menus and env scripts with ". menu.sh" worked like a charm.
cross this one off the list :)
thanks guys
cross this one off the list :)
thanks guys
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP