It is currently Mon, 04 Mar 2024 01:43:15 GMT



 
Author Message
 Best way to set env variables for multiple users or global
I have a RH7.1 box that acts as a server. I had to set POSTGRES_INCLUDE and
POSTGRES_LIB, by including them in .bash_profile for each user. Is there any
master location that I can make such environment variable changes in one
place?


 Thu, 05 Feb 2004 03:41:20 GMT   
 Best way to set env variables for multiple users or global

Look at /etc/profile

if it has some code like

for i in /etc/profile.d/*.sh ; do
        if [ -x $i ]; then
                . $i
        fi
done

You could create a file in /etc/profile.d like
xx_local_site.sh  and it would run last and do
whatever you like. Be sure to   chmod +x xx_local_site.sh
xx_ is to get it to execute last.

Also makes upgrades easier if you do not modify the original files.

If you did not have the "for i in"  code, add your definitions
to /etc/profile

--
The warranty and liability expired as you read this message.
If the above breaks your system, it's yours and you keep both pieces.
Practice safe computing. Backup the file before you change it.
Do a,  man command_here or cat command_here, before using it.



 Thu, 05 Feb 2004 03:54:46 GMT   
 
   [ 2 post ] 

Similar Threads

1. global env. variables for tcsh

2. working with global (env) variables

3. How to set global env in .exrc ?

4. Validating multiple env variables?

5. Setting global environment variables

6. How to set environment variable for global access?

7. Quest: how to set global environment variables?

8. Quest: how to set global environment variables?

9. setting global variables


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software