Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: environment settings



On Mon, Jun 16, 2008 at 02:30:46PM +0200, Marcus Franke wrote:
[...]
> > environment variables can be defined in the ~/.zprofile. Then
> > they are set once, when you log in and inherited by every
> > process. But make sure whatever process logs ou in if it's not
> > your login shell, does read that .zprofile. You might have to do
> > it in .profile and have .zprofile source that .profile.
> 
> My .zshrc just had the "EDITOR=/usr/bin/vim" line but without using
> export :(
[...]

Which in a way makes sense though is not very useful. ~/.zshrc
is your shell configuration file. ~/.zprofile is you session
configuration file.

Generally, in ~/.zshrc, you put stuff that affects the behavior
of interactive shells (sets shell options, defines shell
aliases, configure completions).

In ~/.zprofile, you define what affects any process started in
your session not necessarily only the shell processes.
Typically, $EDITOR is an environment variable used by commands
like crontab, visudo, vipw... So it makes more sense to define
it once and for all for your whole login session.

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author