From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23892 invoked by alias); 14 Mar 2013 13:47:54 -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: 17698 Received: (qmail 12925 invoked from network); 14 Mar 2013 13:47:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.83.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=GPqqIc/KBridWhxsxuRH19+2PsVLtymbLLqZROOzIMA=; b=te8YNUsHrXTfKCv7PpgZmh+Id12VzYeuNbMzjWnOHNf6dJZ53Biv0WC5gOiTAF2kvS mu17Sb0NQScqwhHEf/GElRe4Za8YWlCcNI4kJGZOD2wO8VK1YV/k3xYfebKJkwHCUXse IlS288c6NCREoxnTcTr4P21JiiTw3IbE3uwA7H4cMiYRDfo0oeg9l8dvhEG4V4yMIQij JtQ0N8n701zcNVbtlaFZZlTzSdOrNEHOOLg5TKrhmhp2YetIinAzNwY02IVx6jMlmiV7 278y4oEaGWz+oVtVPRCklo7zoqdx36y2veN0cFCP+00w/R9vbi09EkZjGkKeV2lW9hH+ g18w== MIME-Version: 1.0 X-Received: by 10.14.219.129 with SMTP id m1mr6952534eep.16.1363268431196; Thu, 14 Mar 2013 06:40:31 -0700 (PDT) In-Reply-To: <87ppz3ow4x.fsf@lwm.klanderman.net> References: <7054F6AC-DD66-4174-A199-D30DBF5E5E4A@macports.org> <87ppz3ow4x.fsf@lwm.klanderman.net> Date: Thu, 14 Mar 2013 09:40:31 -0400 Message-ID: Subject: Re: Latest stable release of zsh triggers the addition of paths to $PATH From: James Jong To: gak@klanderman.net Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=047d7b6228f893597704d7e2aaa7 --047d7b6228f893597704d7e2aaa7 Content-Type: text/plain; charset=ISO-8859-1 Thanks Greg! These are fantastic pointers. As for the if statement, I was referring to the first one, i.e. if [ "x$SHLVL" != "x1" ]; then ... fi But I think this thread answers my question: http://stackoverflow.com/questions/4511407/how-do-i-know-if-im-running-a-nested-shell James On Wed, Mar 13, 2013 at 4:57 PM, Greg Klanderman wrote: > >>>>> On March 13, 2013 James Jong wrote: > > > 1) What doest the if statement above test? > > whether the file is readable. the loop loads all readable files > matching the pattern /etc/profile.d/*.sh > > > 2) When I run a zsh script, how can I prevent it from running /etc/zshrc? > > zsh -f > > > 3) When I switch to zsh from tcsh on an interactive shell using exec zsh > -l, > > how I can I prevent it from running /etc/zprofile? > > I use "setopt norcs" in my .zshenv and then specifically load the > files I want to load depending on whether the shell is a login shell, > interactive, etc. You could also use "setopt noglobalrcs" which only > prevents loading the global (/etc/...) ones. Note that without the > "-f" command-line option, you cannot prevent loading /etc/zshenv > (alternately /etc/zsh/zshenv on some systems). > > Greg > --047d7b6228f893597704d7e2aaa7--