Enviroment variable set for all
How do i make an enviroment variable set for all users no matter what their shell is?
|
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. |
That only works if everyone uses bash.
|
For the tsch and csh shells use /etc/csh.login.
|
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.
|
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. |