From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19575 invoked by alias); 9 Feb 2011 16:54:21 -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: 28726 Received: (qmail 19431 invoked from network); 9 Feb 2011 16:54:19 -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: <110209085358.ZM29014@torch.brasslantern.com> Date: Wed, 09 Feb 2011 08:53:58 -0800 In-reply-to: Comments: In reply to Greg Klanderman "Re: loading user startup files for zsh scripts" (Feb 9, 11:01am) References: <19792.22365.139876.599478@gargle.gargle.HOWL> <110207213357.ZM22407@torch.brasslantern.com> <20110208172056.6a985c90@pwslap01u.europe.root.pri> <110208205856.ZM24066@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: loading user startup files for zsh scripts MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 9, 11:01am, Greg Klanderman wrote: } } Is there any way to get the original $0 from within a file that's } being source'd from .zshenv and when functionargzero hasn't been } unsetopt'd? Put something in /etc/zshenv (or whatever path has been compiled for that on your system) that stashes $0 in another parameter. (This is one of the few good uses of /etc/zshenv that I've ever considered; I usually configure --disable-zshenv when building the shell myself.) Or just do the $ZSH_NAME = $0:t test in /etc/zshenv and set a boolean to indicate a script is running.