From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17532 invoked by alias); 28 Mar 2018 13:59:16 -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: 42556 Received: (qmail 18156 invoked by uid 1010); 28 Mar 2018 13:59:16 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f44.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(74.125.82.44):SA:0(-1.9/5.0):. Processed in 0.492417 secs); 28 Mar 2018 13:59:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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=8W1ApdPgzRFIwABW0muYQUWPWEaCGD6YXDSNf5EKAHQ=; b=MTuoi1LKIJf633TARAX+JTGd4w89LuXbjuIgMwpcYd6vZL0x+lrUCtceHoN1QkyKdl a+UcPb8ap2oE/x77/HwqIS1qEIj9e9TtGYN+hMfGUMnOK7lHVx4KpKAhBcibnPFzeiAI tFzOcQhhZ+NbepcDG9kReOGJ65mH1BEn3HhGMHJniCh7qQYk5sXwv9ptHCNHxIUWf8Ft KoXPW6DEHIzo5xvZxhpOijfVxKvZSnt/mpsrFDypE+0uqsxVWZuz7trv3vGy2qt8Dfl4 23L19mncXNbXFWRcPp80e1ns3AY8rIrhTBtIqssOj/5kKO9l+b0sF9TbI5376wl4UAoS 5VOA== 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=8W1ApdPgzRFIwABW0muYQUWPWEaCGD6YXDSNf5EKAHQ=; b=mFDTOHUb4BrG/fpgyDs6n66rrVP37v0c2I1UQ3BGl/WlN2hYKUaOmKWiTLqYA6cM5B 6FfOd9RZQTVbsfDzGegjT+7ArmZn6WDk827HVmUWwxKo/L+8fnlx1bk0BtzDyq1xSZGo bvDeuGhif1lXovfJwA+jOPBOftpTzH3BeQBbdfoLZ7V2eUNMhv9xjiNtPbYuDUvu6QfS oKVOPQ4qEhi6cPGpDafTtUVjNuYFAwVMiZlOTuTFkgQ0hZnnDpdEvkJGSSu/fF2dsFsx 8FFYLa95dDyMhIBye3jxWQIEwAirasks+egz+UYAqaiB0Kz+LaoKMwRkTIgWlMmjbpM3 /xcQ== X-Gm-Message-State: AElRT7HhcqvA45T32U3TWRT022kTWlgCjytMEaBTAfhl4z88+B8L9/rV 783oi4xd9MszCK57owf2YY3UTQ== X-Google-Smtp-Source: AIpwx48r5Y4ckJJCsnS1GdSJfznaJPZfP72wtQdrJVu0p3FYhy4L4A2hRHp2t/7ARDW7t5+E4+yoZQ== X-Received: by 10.28.190.23 with SMTP id o23mr2750049wmf.53.1522245551278; Wed, 28 Mar 2018 06:59:11 -0700 (PDT) Date: Wed, 28 Mar 2018 14:59:09 +0100 From: Stephane Chazelas To: Leah Neukirchen Cc: zsh-workers@zsh.org Subject: Re: _sh doing _normal completion Message-ID: <20180328135909.GA17923@chaz.gmail.com> Mail-Followup-To: Leah Neukirchen , zsh-workers@zsh.org References: <87sh8lfxrf.fsf@gmail.com> <20180327203314.6c6fbdde@ntlworld.com> <87d0zoe2iv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d0zoe2iv.fsf@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) 2018-03-28 15:46:32 +0200, Leah Neukirchen: [...] > The main problem is that it floods the reasonable expansions (from .) > with the full contents of $PATH. [...] Some sh implementations (bash, zsh, AT&T ksh) look-up slash-less commands in $PATH if not found in the currently directory, some (mksh, dash, yash) don't. Both behaviours are allowed by POSIX. ksh88 actually looked it up in $PATH *before* the current directory, causing security vulnerabilities on systems with support for setuid scripts for instance. If you want to run a script in the current directory, I would suggest you get used to typing: sh ./myscr to avoid surprises on those systems that lookup scripts in $PATH. The fact that zsh completes commands in $PATH when you do sh myscr is actually useful as a reminder that it's not a wise thing to do. -- Stephane