Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is quoting of the assigned value needed?
- X-seq: zsh-users 24463
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: Is quoting of the assigned value needed?
- Date: Sat, 23 Nov 2019 19:01:38 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M53tSCUUI6xjWwh0tTxmwuSctRgR+iuy7ZPdHWini2k=; b=oSjRHfGWBgl4CljN4XZ0bqrCChbhHIgQNnRuygSZUtj7BGAEyunM/uK3VgV3YuIIbi rD7GsAqo7SA8TRpb8lB/nWKzT4kiR2+7qEP6nDRgHiiQ4VDMblZhREQQ3qoqBzTDGzlh hOfVQoWm82WLIgNVAFkmL3wWQFnCB2diqSW29vlAzWF6f/xnBbs5VgNv+RYRvzx2gSw2 X1EznxFSqxod4ac5ZjE3VJSQx3GpJOyF0cZUZBn+z8wPorzVcCmJGuZkpeQZQZuQ1KA8 OcaW518A3Un/q/+Ap0UJLUbetYgUI08ZI8pPeiQy8C0gZ26x5N9zkUjmmpG5oOj4tSLk qBow==
- In-reply-to: <CAKc7PVAuuUdky7yegTEH_YbPYhfxSM4coiYD-37h1=p8g_3yPA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20191122020437eucas1p128174332018d20a266f55007fcf271ba@eucas1p1.samsung.com> <CAKc7PVAUqWfNvvJi+k7A9qW7g9w3GqaUTXTML0yWo9fHGUuwbA@mail.gmail.com> <1574419508.4702.10.camel@samsung.com> <CAKc7PVD=eParqe3BgkNP9imnSh4vrjN44fm9=hXPsZ1b=0oMLQ@mail.gmail.com> <1574435173.4702.34.camel@samsung.com> <CAKc7PVAuuUdky7yegTEH_YbPYhfxSM4coiYD-37h1=p8g_3yPA@mail.gmail.com>
On Fri, 22 Nov 2019 at 17:26, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> On Fri, 22 Nov 2019 at 16:08, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> >
> > On Fri, 2019-11-22 at 16:01 +0100, Sebastian Gniazdowski wrote:
> > > I'm thinking on simplifying the plugin standard's proposed $0
> > > handling, which is currently:
> > >
> > > 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
> > > 0="${${(M)0:#/*}:-$PWD/$0}"
> > >
> > > I.e.: about skipping the quoting. Before I do this is want to be
> > > completely sure that it'll always work.
> >
> > Scalar assignment is always scalar assignment, yes. That's basically
> > the meaning of the text I quoted saying why GLOB_ASSIGN got moved out
> > to an option.
I have realized that the GLOB_ASSIGN option together with GLOB_SUBST
will cause problems
in="/root/my_directory()"
setopt GLOB_ASSIGN GLOB_SUBST
0=$in
zsh: no matches found: /root/my_directory()
So technically it can be even said that yes, there's a reason to quote
the value, because there exists a shell configuration that will cause
problems with unquoted assignments. So I'm in doubt if the change to
the standard should be done, i.e.: if the quoting should be removed.
Are there maybe some other configurations of the shell when similar
problems might pop up? This could help to clear the doubt. The
standard now uses unquoted assignment:
http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html#zero-handling
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author