Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Quoting problems
- X-seq: zsh-workers 37993
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Quoting problems
- Date: Tue, 16 Feb 2016 09:33:39 +0000
- In-reply-to: <CAKc7PVDKd1HWgausNPpqzsi0DK+CJp=+LC0tcEa0cDi-4BJmbQ@mail.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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAKc7PVDKd1HWgausNPpqzsi0DK+CJp=+LC0tcEa0cDi-4BJmbQ@mail.gmail.com>
On Tue, 16 Feb 2016 08:53:05 +0100
Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Hello,
> # source test_script > a
> # source ./a
> ./a:156: unmatched "
> ./a:157: invalid function definition
>
>
> It's about following line:
> [[ $#exp -eq 1 && "${exp[1]//\}" = "${word//\}"(|\(N\)) ]]
>
> The first and second backslash aren't quoted and cause the two '{' to
> be unbound.
Looking at your code, I think you'll find this is because you're using
echo without the option not to expand bacslashes. Try "echo -E" or
"print -r". (I'd recommend "print" if this is zsh-specific as echo
is mostly there for backward compatibility, although there's no reason
it shouldn't work here.)
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author