[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/environment



Brad wrote:

> On Wed, 23 Jun 1999, Frank Barknecht wrote:
>
> > stick@richnet.net hat gesagt: // stick@richnet.net wrote:
> >
> > > What if /etc/environment comprised of a series of variable=value statements
> > > that each shell would read and use to set the environment?
> >
> > I would like to add that ssh also reads /etc/environment and expects
> > name=value pairs there only. So if you have lines like:
> >
> > PAGER=less
> > export PAGER
> >
> > in /etc/environment, ssh complains about a bad syntax with this:
> >
> > Bad line in /etc/environment:  export PAGER
> >
> > So even though I only use bash on my system, I can't easiliy keep
> > environment-vars in  /etc/environment without getting ugly warnings by ssh.
>
> i think the original proposal was that /etc/environment would only contain
> name=value pairs. Each shell would parse this file (via a script in
> /etc/profile or whatever default) to insert all those pairs into the
> shell's environment. This way, /etc/environment would work with any shell
> instead of just bash.
>

Exactly!
There would be one location for all shells (bash, tcsh,ssh, X11, etc.) to read and
have the environment variables set.  Additionally, we could use the same scheme to
have a ~/.env for each user.

I'd think that a shell function in Bash would be sufficient, and I'm hacking on one
now.  We'd need the same sort of thing for C-shells - I've not written an C-shell
scripts in nearly 5 years so that would take me a little longer.

But the basic point is that Debian should have *one* file that contains all default
environment variables.

Chuck

--
Chuck Stickelman, Owner                 E-Mail:
Practical Network Design                Voice:  +1-419-610-4201
3068 Noblet Road
Mansfield, OH 44903-8634 USA




Reply to: