From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28004 invoked from network); 2 Sep 2009 15:00:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 2 Sep 2009 15:00:33 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 36456 invoked from network); 2 Sep 2009 15:00:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Sep 2009 15:00:22 -0000 Received: (qmail 18743 invoked by alias); 2 Sep 2009 15:00:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27238 Received: (qmail 18711 invoked from network); 2 Sep 2009 15:00:14 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 2 Sep 2009 15:00:14 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 53A02801E281 for ; Wed, 2 Sep 2009 17:00:07 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id A23481043A8; Wed, 2 Sep 2009 15:00:00 +0000 (UTC) Date: Wed, 2 Sep 2009 15:00:00 +0000 From: Clint Adams To: zsh-workers@sunsite.dk Cc: martin f krafft , 537283@bugs.debian.org Subject: Re: Bug#537283: homing in Message-ID: <20090902150000.GA6966@scru.org> Mail-Followup-To: zsh-workers@sunsite.dk, martin f krafft , 537283@bugs.debian.org References: <20090902070912.GA31041@piper.oerlikon.madduck.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090902070912.GA31041@piper.oerlikon.madduck.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.94.2/9767/Wed Sep 2 10:41:31 2009 on bifrost X-Virus-Status: Clean On Wed, Sep 02, 2009 at 09:09:12AM +0200, martin f krafft wrote: > % precmd_test() { set -x; test -d . && echo . is a directory; set +x; } > % precmd_functions=(precmd_test) > +precmd_test:0> test -d . > +precmd_test:0> echo . is a directory > . is a directory > +precmd_test:0> set +x > % [PRESS CTRL-C] > +precmd_test:0> test -d . > precmd_test:test: argument expected > +precmd_test:0> set +x > > > The same happens with [ -d . ], but /usr/bin/test and /usr/bin/[ > work fine. Thus, there must be something fundamentally out of order > with precmd functions and builtin tests which shows only when precmd > functions are called without a preceding exec() by the shell. > Running an external programme before the test from the precmd > function (e.g. ls >/dev/null) does not work though. > > I can reproduce this with zsh -f. This is the same with precmd()