From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23249 invoked by alias); 3 Aug 2010 10:59:35 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15226 Received: (qmail 12334 invoked from network); 3 Aug 2010 10:59:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Tue, 3 Aug 2010 12:54:05 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: alias in .zprofile - strange effect Message-ID: <20100803105405.GA7217@prunille.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <1280825977.3079.0@numa-i> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1280825977.3079.0@numa-i> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.20-6088-vl-r38367 (2010-07-31) 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 - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)