From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27836 invoked from network); 6 Sep 2006 06:17:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Sep 2006 06:17:18 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 9385 invoked from network); 6 Sep 2006 06:17:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Sep 2006 06:17:11 -0000 Received: (qmail 22459 invoked by alias); 6 Sep 2006 06:17:04 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10688 Received: (qmail 22450 invoked from network); 6 Sep 2006 06:17:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Sep 2006 06:17:04 -0000 Received: (qmail 8307 invoked from network); 6 Sep 2006 06:17:04 -0000 Received: from dsl-63-249-88-2.cruzio.com (HELO dot.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 6 Sep 2006 06:16:59 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id EAEDE1DF; Tue, 5 Sep 2006 23:16:57 -0700 (PDT) Date: Tue, 5 Sep 2006 23:16:57 -0700 From: Wayne Davison To: Chris Johnson Cc: zsh-users@sunsite.dk Subject: Re: Where PATH is set Message-ID: <20060906061657.GA32471@blorf.net> References: <20060905183120.GA10848@cetus30.cs.utk.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060905183120.GA10848@cetus30.cs.utk.edu> User-Agent: Mutt/1.5.13 (2006-08-11) On Tue, Sep 05, 2006 at 02:31:20PM -0400, Chris Johnson wrote: > Peter has some lines in the zsh Guide, section 2.5.10, about how zshenv > is the cleanest place to set environment variables, PATH included. It's my belief that you need to be careful to not force values in an *env file that you might want to override. For instance, if you ever want to pass a custom PATH to a program, you can get bitten by this: PATH=/custom/bin program # works fine PATH=/custom/bin gdb program (gdb) r # might NOT work The above discrepancy is because gdb uses $SHELL to spawn "program". So, if one of the *env rc files sets PATH unconditionally, you can never start a sub-shell with a custom PATH (or whatever other environment variable gets set unconditionally). I like to set environment variables in .zprofile, and then I also put some kluge code in .zshenv that ensures that the file didn't get skipped (which can happen if your login method didn't execute a login shell, as is the case with some--but not all--X11 setups): if [[ $SHLVL == 1 && ! -o LOGIN ]]; then source ~/.zprofile fi ..wayne..