Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is quoting of the assigned value needed?
- X-seq: zsh-users 24460
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: Is quoting of the assigned value needed?
- Date: Fri, 22 Nov 2019 16:01:07 +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=ZnF68od2nW0rZUddMZTlfqo1eOcLj+aGIHHomZoYR3E=; b=qJtC8dqZ5owKhR+tBmDLPlVtw4XSO88a+kU3t0w9Do1wznJx3QiH8SkA4Ubx5HO2++ +/HueQzdT7w3Fn1jYVH2eWfMbdIgxebFlkOfnL1A1XyPJiyK+LzhhHGe+GgjP0VGY2hz teMwIW8vzasfHLT3L264UzstLJVveEKY8+2Ouhbmb1pUWegAlaFRMjDkm1/0Cr1fFreN uQZrxz1I9KO/6q4oFBU1gLBBMhYq3nr8RoCiQTjdjhk8ajOwVPMmx5IPMIz495kY7r5L 3mjzu9glx5muHKH2cfMDmeypj5/tla597gzQ2u+QHm5JAwT4a06lZYJP/o/sgEPUHUS+ XCbg==
- In-reply-to: <1574419508.4702.10.camel@samsung.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>
On Fri, 22 Nov 2019 at 11:46, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
>
> On Fri, 2019-11-22 at 03:03 +0100, Sebastian Gniazdowski wrote:
> > Hello,
> > SH_WORD_SPLIT doesn't seem to cause any effects in this context:
> >
> > setopt SH_WORD_SPLIT
> > var1="a b"
> > var2=$var1
> > print "$var2"
> >
> > Output: a b
>
> Correct, there's no splitting there: you've got a quoted assignment, a
> single word assignment, and quoted output.
>
> What you should be doing depends on what you're trying to do, which you
> don't say.
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.
> Do you want var2 to be an array of split parts of $var1? In
> that case, do an array assignment.
>
> var2=($var1)
>
> pws
>
--
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