LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setup environment variables for groups (https://www.linuxquestions.org/questions/linux-newbie-8/setup-environment-variables-for-groups-814194/)

Jerry Mcguire 06-15-2010 01:37 AM

setup environment variables for groups
 
I can setup variables in ~/.bashrc for my own shells.
I can also setup variables globally in /etc/bashrc .

but then how do I setup variables for a group in Linux? So that users who belong to this group will see the variables, but not others?

Thanks

colucix 06-15-2010 02:40 AM

In the global configuration file a simple check using the id command should do the trick. For example:
Code:

if [[ $(id -g) -eq 100 ]]
then
  export SOMETHING=some_value
fi


Jerry Mcguire 06-16-2010 10:01 PM

I was think the same. Thanks.


All times are GMT -5. The time now is 03:19 PM.