From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43537-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 37af111f for ; Mon, 24 Sep 2018 22:18:44 +0000 (UTC) Received: (qmail 16580 invoked by alias); 24 Sep 2018 22:18:29 -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: List-Unsubscribe: X-Seq: 43537 Received: (qmail 48 invoked by uid 1010); 24 Sep 2018 22:18:29 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.221.54):SA:0(-1.9/5.0):. Processed in 3.402237 secs); 24 Sep 2018 22:18:29 -0000 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1AKrLNMZdLx0z+icbyqR0DT/jNUNm1dZsDYoC0uEcfI=; b=ALBPMUPyoLZZqH1U0mH/Q19V31nBvMg20YDfFcHHsgQQD3GbcQKkxGNfHqh6vRADhl ddNulluiIGOrxjJhVZK0LbcfuJk3GJC+QGzSB0rG2iTW+oCv2i9pIaKrSdL/DXCqX42N ZB2u/rZMslwrWlhxuzN90cafBldHq6mp3i13B4dbIQ0EdT4AxLB42G9tti8KnuZQx8PQ ejO4yhcjB8Ftecek/jzBdWf4cX5Su5BQJeCkX3SRboA4fY5HD0XATHzDDhnogTnKqOh5 4SzovbOpVN96mFQ1iaEypRutsvyD/LHzkaUuXD27Ox0uGStChUeWA7+cClQxtLlhS2on 01dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=1AKrLNMZdLx0z+icbyqR0DT/jNUNm1dZsDYoC0uEcfI=; b=EgiikZNBHPpGKYV+ytIZhkMlTXVpZLi/HVqTFZTrxWJ67dunMr4Cf6kt5GLdWwOubS F/pLyZV/FmZmJSoe87MJVb00P5cqMSARRv4/zhWHly9GedhJp1HWACD9VA470ssJ1JWV rruTAvmDuYDAT3FAbYUeBQOxA9byRM6orvxF8Z4gQFVNwPMXkeWPZhlycpEKXaFcP9k4 zCgmCIDxgNjoU/Z/XKRePEixCnpU39T2LsaSaKJvjJvb85HLHSnFxJR8x2efNVOXz7uo G8d3pneTVET2WyrpG3bC5AmUfFr/R40BjV12WzMa4ZJ/CqdXkIslsOmPEFg1AuvXtI5f P9Lg== X-Gm-Message-State: ABuFfohvqjD/Mqoutre02IGiMy8owKQD9wQuu0jTPIfHYYIisBf/a8QZ mAdGnBKQ27NWu6d6z2z+1wYAm/zWgJQ= X-Google-Smtp-Source: ACcGV62xE2OjHB6faF5VaEfHcyY0hAQNbneaCFWCDg72qWeUWe5C5K1SSinMp+eWYw5wbkZVj5YgUA== X-Received: by 2002:adf:ae5a:: with SMTP id u26-v6mr590497wrd.246.1537827501847; Mon, 24 Sep 2018 15:18:21 -0700 (PDT) Date: Mon, 24 Sep 2018 23:18:20 +0100 From: Stephane Chazelas To: Peter Stephenson Cc: Zsh Workers Subject: Re: BUG: Shell builtin `which` prints non-existent commands to stdout Message-ID: <20180924221820.opyz3vnlo4wquy35@chaz.gmail.com> Mail-Followup-To: Peter Stephenson , Zsh Workers References: <20180924080031.ee7lqmthxpmvqaal@klaus.seistrup.dk> <20180924102219eucas1p2469f827265423a2f3b5e7d98fc08412e~XTuQ1aIyy2293622936eucas1p2L@eucas1p2.samsung.com> <20180924122933.gpzp4vfix6zl66nw@klaus.seistrup.dk> <20180924125126eucas1p2e4ae5b63ce6320957ee99737f93181ae~XVwcoX7b91518615186eucas1p2T@eucas1p2.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180924125126eucas1p2e4ae5b63ce6320957ee99737f93181ae~XVwcoX7b91518615186eucas1p2T@eucas1p2.samsung.com> User-Agent: NeoMutt/20171215 2018-09-24 13:51:24 +0100, Peter Stephenson: > On Mon, 24 Sep 2018 14:29:33 +0200 [...] > + The original reason for this is that this behaviour is inherited > + from the C shell (csh), where `tt(which)' itself orignated. So > + it has been in zsh a very long time, and it is now a feature. > + (It would be possible to change this in emulation modes; however. > + so far this possibility has been seen has more of an additional > + confusion than a help.) [...] csh had no "which" (tcsh has a which builtin), but there was a "which" csh script added to 3BSD 1980 that was looking up commands in $PATH and in the aliases defined through ~/.cshrc. https://github.com/dspinellis/unix-history-repo/blob/BSD-3/usr/ucb/which There's no easy way to write something to stderr in csh, so it's not surprising that that script didn't. In any case, the "command not found" can be seen as the normal output of which, it is *the* information that it is returning for that command. zsh is not the only shell for which "type not-a-command" doesn't output "command not found" on stderr. The Bourne shell, pdksh and derivatives and ash-based shells do as well. -- Stephane