From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18425 invoked by alias); 1 Sep 2015 06:12:06 -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: 36357 Received: (qmail 26186 invoked from network); 1 Sep 2015 06:12:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YIC+eIwY4gTuc2Yrlh/oliInv1OmnoCdUf8ywdjkorM=; b=YxUMUh06PF+ePDFNZ/NEPV25NdRF7iFZienEaQ6rfqS70cOTTkjLdqJ3qGP6F+MuCv XeDOF4I5IMAGn9TUK/GzcbFdwcYZux1arcih59X/pBsE1JORL0U25bzPFGKBMhyC8Biv K644SpYjxUEgJocKE+KIjx3SOzbmvETQLWnnwUoyS04mJGU6B5p4ETD4jg7sGJRaa3mG areQtxQQbsTdmnHJYOCCPv2Vy3af3gP8anP9InIXuGOG/2a6ejEdbTRMmv+5n5is2pQN L40iLYSCG3TvDJv2yMsUu9CeE3lw/rufShYGSl6li9/tZWrmRznfHY6blk7NXtn3IhW+ lHZQ== MIME-Version: 1.0 X-Received: by 10.55.197.84 with SMTP id p81mr16154279qki.90.1441087922975; Mon, 31 Aug 2015 23:12:02 -0700 (PDT) In-Reply-To: <150831230431.ZM894@torch.brasslantern.com> References: <20150830030614.GB18893@frozen.localdomain> <20150830052603.GE18893@frozen.localdomain> <150831230431.ZM894@torch.brasslantern.com> Date: Tue, 1 Sep 2015 08:12:02 +0200 Message-ID: Subject: Re: [patch] "which"-builtin writes diagnostics to stdout From: Mikael Magnusson To: Bart Schaefer Cc: Zsh hackers list , Timo Buhrmester Content-Type: text/plain; charset=UTF-8 On Tue, Sep 1, 2015 at 8:04 AM, Bart Schaefer wrote: > On Aug 30, 7:26am, Timo Buhrmester wrote: > } Subject: Re: [patch] "which"-builtin writes diagnostics to stdout > } > } > > | % which doesnotexist > } > > | doesnotexist not found > } > > > } > > the "doesnotexist not found" message goes to standard output, > } > > rather than standard error. > } > } Out of curiosity, what reason would zsh (being more bourne-ish than > } csh-ish, as far as I can tell) have to maintain this particular csh > } glitch rather than fixing it? > > What makes you think it's a glitch? > > I.e., "not found" here is not an error message! It is the answer to the > question you asked, and you asked for the answer in csh format ("which" > is "whence -c"). If you don't want csh behavior, you should be using > "whence" directly so that you can omit the "-c" option. I guess the problem here is that in other shells, whence does not exist, and which prints 'not found' to stderr. Zsh's which acts like the csh variant even in the sh emulation, so finding the absolute path of a command portably is pretty difficult. (In bash, both type and which print 'not found' on stderr. In dash, which prints to stderr and type prints to stdout. In zsh both print to stdout. type additionally prints the extra 'foo is' first so it's less useful). -- Mikael Magnusson