- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 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
01-23-2006 02:49 AM
01-23-2006 02:49 AM
environment variables
i have simple question: how can i set up environment variables for each user?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 02:51 AM
01-23-2006 02:51 AM
Re: environment variables
export FOO=bar
for example.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 02:52 AM
01-23-2006 02:52 AM
Re: environment variables
set them up in the users login script, found in the users home directory:
ls -a
for example in .profile
export ORACLE_HOME=/u01/app/oracle/9.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 02:53 AM
01-23-2006 02:53 AM
Re: environment variables
if you want to set the environment for all users have a look at the scripts in /etc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 02:57 AM
01-23-2006 02:57 AM
Re: environment variables
You can declare and export environmental variables in a user's profile.
Often, a better approach, however, is to build and export all of the variables in a separate file.
The resulting file can be sourced (read) by the login profile, scripts or applied to a crontab entry.
To source (reaad) one file from another, simply do:
# cat ./sourceme
#!/usr/bin/sh
export WHO=Kolb
# cat ./somescript
#!/usr/bin/sh
. ./sourceme
echo "I am ${WHO}"
Thus sourcing is done by writing a dot (".") followed by a space (" "), followed by the file to source (read).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 02:58 AM
01-23-2006 02:58 AM
Re: environment variables
You can set them in the users individual .profile located in their home directory.
for example if if you want their prompt to show the the system name and current directory enter the follwing line
export PS1=`uname -n`:'$PWD # '
or to set a command history file:
HISTFILE=$HOME/.sh_history;export HISTFILE
or to set default editor to VI
EDITOR=vi
EXPORT EDITOR
As you can see, there are multiple ways to set the variables.
If the users are using a graphical interface, you will need to either modify their .dtprofile as well, or tell the .dtprofile to read the .profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 02:58 AM
01-23-2006 02:58 AM
Re: environment variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 03:00 AM
01-23-2006 03:00 AM
Re: environment variables
here you have an overview of the login procedure:
http://docs.hp.com/en/A1700-90014/ch03s08.html
Regards