From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1176 invoked from network); 4 Aug 2003 02:57:40 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Aug 2003 02:57:40 -0000 Received: (qmail 12259 invoked by alias); 4 Aug 2003 02:57:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6429 Received: (qmail 12249 invoked from network); 4 Aug 2003 02:57:29 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 4 Aug 2003 02:57:29 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [199.67.51.101] by sunsite.dk (MessageWall 1.0.8) with SMTP; 4 Aug 2003 2:57:29 -0000 Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h742vOIp062447; Sun, 3 Aug 2003 21:57:24 -0500 (CDT) (envelope-from dan) Date: Sun, 3 Aug 2003 21:57:24 -0500 From: Dan Nelson To: Nikolai Weibull Cc: zsh-users@sunsite.dk Subject: Re: ~/.zshenv or ~/.zprofile Message-ID: <20030804025724.GI38843@dan.emsphone.com> References: <20030803221858.GA2720@puritan.pcp.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030803221858.GA2720@puritan.pcp.ath.cx> X-OS: FreeBSD 5.1-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i In the last episode (Aug 04), Nikolai Weibull said: > I've always put all my environment stuff in ~/.zshenv. Lately, > however, I've come to realize that that may not be such a good idea. > I mean, the environment is passed down as it is, why tell shells the > same information again? The problem really is that if you put, for > example, your PATH definition in ~/.zshenv, and have a script or > application that modifies PATH and later runs a shell, that shell > will not use the specifically crafted PATH, but will read the > standard one from ~/.zshenv. An example would be procmail with > ~/.procmailrc. I have the lines: > PATH="/usr/bin:/bin" > SHELL="/bin/zsh" > in my ~/.procmailrc. I recently realized that, as I had set the > shell for procmail to invoke sub-processes with to Zsh, that the PATH > setting had no effect. This was rather bad, as I was doing some echo > debugging in my ~/.zshenv and a lot of mails got messed up in the > process. So, anyway, is there _any_ reason to put stuff in > ~/.zshenv, and, if so, what? zshenv is the only script sourced by cron jobs, so I put PATH and shell functions I might use in scripts in there. BTW - do this so you don't override an existing PATH: path=(/usr/local/bin /usr/local/sbin /sbin /usr/sbin /bin /usr/bin $path) typeset -U PATH # remove duplicate entries -- Dan Nelson dnelson@allantgroup.com