Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _sh doing _normal completion
- X-seq: zsh-workers 42556
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Leah Neukirchen <leah@xxxxxxxx>
- Subject: Re: _sh doing _normal completion
- Date: Wed, 28 Mar 2018 14:59:09 +0100
- Cc: zsh-workers@xxxxxxx
- 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==
- In-reply-to: <87d0zoe2iv.fsf@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Leah Neukirchen <leah@xxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <87sh8lfxrf.fsf@gmail.com> <20180327203314.6c6fbdde@ntlworld.com> <87d0zoe2iv.fsf@gmail.com>
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<Tab>
to avoid surprises on those systems that lookup scripts in
$PATH. The fact that zsh completes commands in $PATH when you do
sh myscr<Tab> is actually useful as a reminder that it's not a
wise thing to do.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author