- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Which file contains 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
11-27-2006 07:19 PM
11-27-2006 07:19 PM
In my server., I want to modify the environment variables..
______________________
bash-2.05$ env
PWD=/
TZ=Asia/Calcutta
LC_MESSAGES=C
HZ=100
HOSTNAME=nibappsun08
LD_LIBRARY_PATH=/usr/local/lib
LC_TIME=en_US.ISO8859-1
MACHTYPE=sparc-sun-solaris2.9
MAIL=/var/mail/fastuser
OLDPWD=/etc
EDITOR=vi
JAVA_HOME=/usr/jdk/jdk1.5.0_08
LC_NUMERIC=en_US.ISO8859-1
LOGNAME=fastuser
SHLVL=2
LC_CTYPE=en_US.ISO8859-1
SHELL=/bin/sh
HOSTTYPE=sparc
OSTYPE=solaris2.9
HOME=/usr/local/fastuser
TERM=xterm
PATH=/usr/bin::/usr/jdk/jdk1.5.0_08/bin
LC_MONETARY=en_US.ISO8859-1
LC_COLLATE=en_US.ISO8859-1
_=/usr/bin/env
bash-2.05$
_____________
Which file I need to modify for the changes to take effect after a restart..
For a specific user I can put in .profile file in the home directory.
But I need to modify it universally, hence all the users will get impact with the settings.
Thanks & Regards
Suseendran .A
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2006 07:23 PM
11-27-2006 07:23 PM
SolutionWhen bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
So you can add your modifications in /etc/profile and this will affect all users.
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2006 07:23 PM
11-27-2006 07:23 PM
Re: Which file contains environment variables?
/etc/profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2006 07:30 PM
11-27-2006 07:30 PM
Re: Which file contains environment variables?
Note you don't want to modify all of these, some are user specific.
The most important one is OSTYPE, you should set it to HP-UX. ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2006 07:43 PM
11-27-2006 07:43 PM
Re: Which file contains environment variables?
But i found only the few tings there in /etc/profile.
__________________________
bash-2.05$ cat profile
#ident "@(#)profile 1.19 01/03/13 SMI" /* SVr4.0 1.3 */
# The profile that all logins get before using their own .profile.
trap "" 2 3
export LOGNAME PATH
if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi
# Login and -su shells get /etc/profile services.
# -rsh is given its environment in its .profile.
case "$0" in
-sh | -ksh | -jsh | -bash)
if [ ! -f .hushlogin ]
then
/usr/sbin/quota
# Allow the user to break the Message-Of-The-Day only.
trap "trap '' 2" 2
/bin/cat -s /etc/motd
trap "" 2
/bin/mail -E
case $? in
0)
echo "You have new mail."
;;
2)
echo "You have mail."
;;
esac
fi
esac
umask 000
trap 2 3
JAVA_HOME=/usr/jdk/jdk1.5.0_08
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
bash-2.05$
______________________________
But how can I set the timezone., since i dont found any entry for timezone in /etc/profile
TZ=Asia/Calcutta
Time Zone Variable
Regards
Suseendran .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2006 07:54 PM
11-27-2006 07:54 PM
Re: Which file contains environment variables?
That's the way it should be, few as possible.
The others are set based on the user's .profile in their home directory.
>But how can I set the timezone, since I dont found any entry for timezone in /etc/profile
TZ=Asia/Calcutta
The same as the others:
TZ="Asia/Calcutta"; export TZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2006 10:38 PM
11-27-2006 10:38 PM
Re: Which file contains environment variables?
I declared the variables inside the /etc/profile file and it is replicating to all the users..
Regards
Suseendran .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2006 07:48 PM
11-30-2006 07:48 PM