From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18834 invoked by alias); 8 Feb 2011 17:49:58 -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: 28718 Received: (qmail 15767 invoked from network); 8 Feb 2011 17:49:55 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Tue, 8 Feb 2011 17:20:56 +0000 From: Peter Stephenson To: Subject: Re: loading user startup files for zsh scripts Message-ID: <20110208172056.6a985c90@pwslap01u.europe.root.pri> In-Reply-To: References: <19792.22365.139876.599478@gargle.gargle.HOWL> <110207213357.ZM22407@torch.brasslantern.com> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.8 (GTK+ 2.20.1; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.11.49] X-Scanned-By: MailControl A_10_80_00 (www.mailcontrol.com) on 10.71.0.141 On Tue, 8 Feb 2011 12:09:41 -0500 Greg Klanderman wrote: > What's the best way to determine that the shell is running a script? You can test if [[ $0 == zsh ]]. If it is, either you're running a script helpfully called zsh, or you're not running a script at all. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom