From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6633 invoked by alias); 8 Feb 2011 05:34:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28716 Received: (qmail 12650 invoked from network); 8 Feb 2011 05:34:16 -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,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110207213357.ZM22407@torch.brasslantern.com> Date: Mon, 07 Feb 2011 21:33:57 -0800 In-reply-to: <19792.22365.139876.599478@gargle.gargle.HOWL> Comments: In reply to Greg Klanderman "loading user startup files for zsh scripts" (Feb 7, 3:34pm) References: <19792.22365.139876.599478@gargle.gargle.HOWL> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh list Subject: Re: loading user startup files for zsh scripts MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 7, 3:34pm, Greg Klanderman wrote: } } As far as I can tell other shells inhibit loading user startup files } when invoked as a shell script (i.e. #!/bin/zsh). Should '-f' be the } default for this use case? In a word, no. Zsh already "inhibits" /etc/zprofile and ~/.zprofile when the shell is not a login shell, and further skips /etc/zshrc and ~/.zshrc when the shell is not interactive. The only file for which -f matters during script startup is ~/.zshenv. The whole reason that ~/.zshenv exists is to contain commands that are intended to be sourced by *every* zsh including scripts. This was a deliberate design decision; if you don't want any such initialization done, you can remove that file. Incidentally, documentation oddness [this has probably been mentioned before]: If zsh is configured with --disable-zshenv, then references to /etc/zshenv in the documentation are replaced with the word "no", which leads to phrases like "Commands are first read from no; this cannot be overridden" and "As no is run for all instances of zsh, it is important that it be kept as small as possible."