Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: environment settings
- X-seq: zsh-workers 25211
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: environment settings
- Date: Wed, 18 Jun 2008 10:11:08 -0700
- In-reply-to: <20080618115227.GZ5016@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080617125834.GI5016@xxxxxxxxxxxxxxx> <20080617131154.GM10734@xxxxxxxxxxxxxxxxxxx> <20080617132611.GL5016@xxxxxxxxxxxxxxx> <237967ef0806170628m56b80d3anaf252e68ad6c497d@xxxxxxxxxxxxxx> <20080617142557.GO5016@xxxxxxxxxxxxxxx> <20080617155429.GT10734@xxxxxxxxxxxxxxxxxxx> <20080617160009.GS5016@xxxxxxxxxxxxxxx> <20080617195007.GV10734@xxxxxxxxxxxxxxxxxxx> <20080617203229.GU5016@xxxxxxxxxxxxxxx> <20080618103808.GB10734@xxxxxxxxxxxxxxxxxxx> <20080618115227.GZ5016@xxxxxxxxxxxxxxx>
On Jun 18, 12:52pm, Stephane Chazelas wrote:
}
} Most of the processes a user every runs are run during his login
} session.
}
} Basically, there's nothing for "a file that should set env
} variable for every process run by this given user".
The definition of a "login session" has unfortunately become very
uncertain. The Gnome desktop via GDM on Ubuntu, for example, does
not perform "login session"-type initialization (or at least, does
not do so in a way specific to the user's shell from /etc/passwd).
The default gnome-terminal configuration also does not create login
shells when opening new windows. Without some more-than-trivial
knowledge of Gnome configuration, there is no way for a user to
accomplish the things that you attribute to a single login session.
} - ~/.forward: depends on the MTA, I don't think the user's shell
} is involved.
It depends on the program invoked (procmail derives $SHELL from
/etc/passwd -- users are often advised to add SHELL=/bin/sh early
in their .procmailrc unless they know exactly what they are doing).
Also, there are ways other than the .forward that filter programs,
etc. can be invoked from an MTA.
} But in all the cases above, the user can explicitely call a "sh"
} that sources a file that does the "exports".
Even granting that this is true, why solve the same problem again
every time a new situation comes up?
For example purposes, here's part of what I do in .zshenv:
----
if [[ -O $HOME ]]
then
# Use version-controlled configuration library if available
[[ -d $HOME/.zsh ]] && ZDOTDIR=$HOME/.zsh
else
# Not me, or not my home directory, don't read the startup files
setopt NO_RCS
return 0
fi
PATH=${ZSH_ENVPATH:-$PATH}
export ZSH_ENVPATH=$PATH
----
This is followed by some miscellaneous stuff to delete stupid settings
that misguided Linux packagers have at various times placed in the
/etc/zshenv file, and set $fpath in case $0 indicates I'm running zsh
from a non-standard location (like out of my development sandbox). The
ZSH_ENVPATH setting assures that I can always reset $PATH to the system
default before modifying it.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author