LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Enviroment variable set for all (https://www.linuxquestions.org/questions/slackware-14/enviroment-variable-set-for-all-37671/)

ChimpFace9000 12-08-2002 03:08 PM

Enviroment variable set for all
 
How do i make an enviroment variable set for all users no matter what their shell is?

Bluesuperman 12-08-2002 07:50 PM

I think if you create it in the profile file (/etc/profile) that would do it or you create create on boot up by placing it in the rc.local file.

I am not sure if these would work, never had to test it for multipe users.

ChimpFace9000 12-08-2002 09:11 PM

That only works if everyone uses bash.

Excalibur 12-08-2002 11:07 PM

For the tsch and csh shells use /etc/csh.login.

ChimpFace9000 12-09-2002 07:44 AM

Im not looking to do it when a shell starts up anyway. I want to set the variable for like init or something like that so it will apply to all children.

NSKL 12-09-2002 09:39 AM

I think it will work like this. At least in Slackware, i use this method to setup the default prompt for bash (PS1 variable)
Make a shell script and put it in /etc/profile.d/yourscript.sh and make sure it's executable. As far as i know all shells load the scripts found in this dir.
To assign a value to a variable for everyone, i think something like this will work
#!/bin/bash
VAR="value"
VAR2=value

HTH
-NSKL


All times are GMT -5. The time now is 06:40 PM.