- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How do I set ENVIROMENT
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
02-26-2002 07:11 AM
02-26-2002 07:11 AM
How do I set ENVIROMENT
What do I need to do so that the enviroment will allways be in the PATH. Do I need to make an entry in some files.
Thanks & Regards
Naren.S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:12 AM
02-26-2002 07:12 AM
Re: How do I set ENVIROMENT
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:22 AM
02-26-2002 07:22 AM
Re: How do I set ENVIROMENT
e.g.
MYVAR=xxx
export MYVAR
You then can set it the same way in the user's
.profile in his home directory (ksh,sh) or in
.cshrc if using csh.
Note that the .profile entries occur after the /etc/profile settings, so that the .profile can override the /etc/profile values. However, any user can then simply do
a MYVAR=yyy; export MYVAR and that MYVAR is then changed for that process and any of its children regardless of the original value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:22 AM
02-26-2002 07:22 AM
Re: How do I set ENVIROMENT
Like 'sh', ksh using /etc/profile as the global profile and $HOME/.profile as the user specific profile.
In csh, /etc/csh.login is the global profile and $HOME/.login is the user specific profile.
For making any changes to the environmental variables ( permanently) you can edit these files.
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:42 AM
02-26-2002 07:42 AM
Re: How do I set ENVIROMENT
If you want some directories be included in the PATH variable you should add them in the file /etc/PATH. See /etc/MANPATH too.
Best regards,
Mario.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 09:57 AM
02-26-2002 09:57 AM
Re: How do I set ENVIROMENT
it depends on how your systems are configured:
/etc/profile is read for each user who logs onto the system. So put things like variables here to be sure everyone has them.
.cshrc is read everytime, you open a c-shell if this file exists in your home- directory.
.login is read, if you use a c- shell as login-shell and if the file exists in your home- directory when you login.
.kshrc is read every time, when you open a korn- shell and if this file exists in your home- directory.
.profile is read every time, when you login, and don't use CDE, or when logging in and if you commented out the line
DTSOURCEPROFILE=true
in your .dtprofile in home- directory and if you use korn- bourne- or POSIX- shell. So you have to take care that these files exist and are configured properly. ( have a look into /etc/skel to find out if the needed files are there.... )
The only thing you have to do now is to find out which of these files you need and to put the variables into them. Take care, c- shells use a different syntax to assign values to variables:
setenv var = value
export var
All other shells use:
export var=value
only bourne shell can't do this, you have to use two commands here:
var=value; export var
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 11:05 AM
02-26-2002 11:05 AM
Re: How do I set ENVIROMENT
Take a look at this thread,
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90046/B2355-90046_top.html&con=/hpux/onlinedocs/B2355-90046/00/00/71-con.html&toc=/hpux/onlinedocs/B2355-90046/00/00/71-toc.html&searchterms=environment%7cshell&queryid=20020226-110910
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2002 07:19 AM
03-01-2002 07:19 AM
Re: How do I set ENVIROMENT
what do you mean by:
"What do I need to do so that the enviroment will allways be in the PATH"?
Do you simply wish to define PATH depending on the shell used?
You should consult the manpages of the various shells.
In each, near the bottom you will find a FILES section which lists all files relevant to the shell.
As a general rule of thumb, here I have to correct Peter, one can say that all login shells from the *Bourne* shell family (e.g. sh, ksh, bash) first source /etc/profile.
This is the file where root places environment definitions valid for all Bourne-compatible login shells.
The shells from the C-Shell family (e.g. csh, tcsh) instead have /etc/csh.login as
such a file.
In HP-UX's /etc/profile you will notice a statement similar to
PATH=`cat /etc/PATH`
which dumps the contents of HP-UX's special file /etc/PATH in the global PATH environment variable.
So on HP-UX root should set the general PATH for every account with a login shell rather in /etc/PATH.
The same goes for the env var MANPATH.
Besides, every user is free to (re)define ones own environment settings in their home directory by placing commands in .profile (sh, ksh, bash), .bash_profile (bash), .login (csh, tcsh).
However, the settings therein only become effective for login shells.
If you wish to have your settings in every shell you may define an environment variable ENV which is set to another commands file in your $HOME (this holds for ksh, and HP-UX's posix-sh).
Usually one would take .shrc (or .kshrc, .bashrc) as a filename for that.
The c-shells (and bash) have additionally a .logout file for commands to be executed right before logout (e.g. some clean up stuff)
You can mimic this in HP-UX's posix-sh by trapping SIGEXIT or 0 in your .profile
e.g.
trap 'echo by $LOGNAME' 0
If you have other files where you make certain settings, you can always source them, so that (re)definitions become valid in your current shell.
Use either the . (Bourne shells), or the source command (C-shells, Bash).
Setting of environment variables is as simple as setting any normal shell variable, but additionally you have to export it
MY_VAR=BlaBla
export MY_VAR
for the Bourne shells
setenv MY_VAR = BlaBla
for the C-shells
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2002 06:54 PM
03-01-2002 06:54 PM
Re: How do I set ENVIROMENT
echo '*loginShell: true' >> $HOME/.Xdefaults
Then logout and log back into CDE. Now, terminal windows will behave like 'mormal' Unix.
Bill Hassell, sysadmin