Content-Length: 2937 Lines: 74 Howdy All!
This question - though simply stated - does produce an intereting problem. Namely that there exists no *one* place a person can set system-wide environmanet variables. So far we've seen responces that indicate that Bourne-like shells will use /etc/profile by default, and that C-shell-like ones will use /etc/csh.cshrc, and that X11 uses /etc/environment. But what about zsh!? According to it's man page it doesn't make use of any of those files. So now what do we do? Ask the Systems Administrators to edit and synchronize 3, 4 or 5 files!? And then what happens when someone writes yet another shell that doesn't make use of any of those files? There's a problem here, clearly. It *could* be solved by expecting the Sys. Admins. to strictly limit which shells are available to the end-user population, but I don't think that'd go over well. We could also leave it as is and let the Sys. Admins. work it out, also a poor choice. However, there could easily be a way around all of this. What if /etc/environment comprised of a series of variable=value statements that each shell would read and use to set the environment? Doing it that way would require each shell maintainer to modify some of their scripts once and only once and for someone to write a reasonable default /etc/environment. We could quite easily expand it to allow for ~/.env[ironment] in order to make user specific changes centralized as well. Of course someone would have to write a policy guideline to issure that any new shells would conform to this new standard, but it wouldn't be that big of a deal, IMO. I've played around with something like this in the recent past and it worked fairly well - though I did it using some grissly looking enviroment variables that each shell would substitute and then read an ugly /etc/environment. It was fairly nasty looking, but functional. I'm sure we good make it much cleaner with just a bit of shell-scripting. Comments? Questions? Opinions? [Jean-Philippe Gu_rard] said [Charset iso-8859-1 unsupported, filtering to ASCII...] > On Fri, Jun 18, 1999 at 01:31:39PM +0200, Marco Maggesi wrote: > > > I saw a file /etc/environment > > who reads it ? > > It is automatically read by X11 on startup. > > You can also add something like : > > [ -f /etc/environment ] && . /etc/environment > We'd have to add a little more logic hear to actually interpret the contents of /etc/environment and do the actual export call. > in /etc/profile to have bash read it automatically for login shells. We'd also want to remember that various shells don't always understand Bourne syntax - `export PATH=/bin` wouldn't work for a C-shell. Don't kow what syntax zsh uses... > > Hope it helps. > > Jean-Philippe > Chuck -- Chuck Stickelman, Owner E-Mail: <[EMAIL PROTECTED]> Practical Network Design Voice: +1-419-529-3841 9 Chambers Road FAX: +1-419-529-362