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