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

Re: alias in .zprofile - strange effect



On 2010-08-03 10:59:37 +0200, Helmut Jarausch wrote:
> And I've debugged it, .zprofile has been run during startup.

The .zprofile is sourced only by login shells. This is good for
environment variables (though I usually use .zshenv for that),
which are inherited by subprocesses, but not for aliases, which
are local to each shell instance. So, aliases need to be defined
by each shell instance. The .zshrc (sourced by interactive shells)
is generally what one wants for aliases. Of course they won't be
available in scripts.

I use a .zalias file, which I source from .zshrc:

  [[ -r ~/.zalias ]] && source ~/.zalias

and from scripts for which I want my usual aliases.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)



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