From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26974 invoked by alias); 1 Sep 2015 13:14:33 -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: 36368 Received: (qmail 2607 invoked from network); 1 Sep 2015 13:14:31 -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=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9wgBRgWBSh4H8JeaxTENnAkAEp8I0X4gjUD+sBNcYyo=; b=IueODTqtPMh8Nhiuy3h6segLGHeecj3VxHF8BXc+nqYO1jwr0xBhKtXjtqpcMmI8V3 vONmF33qimug/vyR8mTmrta7+V9nnat0sWVfDkq8JWAUYAmhGjRc9LWs2fWFUQ37BE5p +ryuT00a00hnxaFF70BM8PxoO1gM/yllbE8bCQiVnUB+h2Fu7nx4ykV1YJsN1allGL/n h5nWSV+n1zf+S0n3v44pPTw3lMIbKWP6ATSsDhbaIbpGvyXJpc/ORhILkfoIJVO8Clb2 ksYwvMmge9X6rEkU6HAqz3VWqLrUXTiQk6PerDUZ1MdS6SppEqJI8Vc7hc1wv+cggp8K zgSQ== X-Received: by 10.180.91.131 with SMTP id ce3mr3432094wib.84.1441113264970; Tue, 01 Sep 2015 06:14:24 -0700 (PDT) Date: Tue, 1 Sep 2015 15:14:22 +0200 From: Timo Buhrmester To: Bart Schaefer Cc: Zsh hackers list Subject: Re: [patch] "which"-builtin writes diagnostics to stdout Message-ID: <20150901131422.GA22568@frozen.localdomain> References: <20150830030614.GB18893@frozen.localdomain> <20150830052603.GE18893@frozen.localdomain> <150831230431.ZM894@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <150831230431.ZM894@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) > } 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 It seems to me like a diagnostic message intended for human consumption, mainly because there's an infinite number of ways it could answer the same thing (``I can' find '' and ``no such '', etc). So unless on the other end of the pipeline you have a human, or a program that understands English, you'll have to deal with this as a special case. Heck, I could even have a file named ``foobar not found'' sitting around, making things worse. :) I obviously can't argue with behavior of ancient shells, but IMO there is exactly one correct, unambiguous and machine-readable answer to the ``which'' question: The empty answer. > 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. Okay, I didn't know about that. Doesn't make my point less valid, but I'm glad there's a way out with `whence`. Thanks. Timo