Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why a '-quoted string isn't respected by // subst, while \-quoted is?
- X-seq: zsh-users 28784
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Why a '-quoted string isn't respected by // subst, while \-quoted is?
- Date: Wed, 25 Jan 2023 14:10:26 +0100
- Archived-at: <https://zsh.org/users/28784>
- In-reply-to: <CAKc7PVC8DMPJJFY64sErMhdgS3mwRFe0fz5hPKJ-vuBh8bX=rg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAKc7PVCm3sSqvnCT+aHHRpsKqFq93d7gtMLHD0-sEE7ZVZ-1gw@mail.gmail.com> <CAN=4vMo6Aeia8P12-=-bh00xZnT9m7REMrMveRDSdUd9SMtfHQ@mail.gmail.com> <CAKc7PVC8DMPJJFY64sErMhdgS3mwRFe0fz5hPKJ-vuBh8bX=rg@mail.gmail.com>
On Wed, Jan 25, 2023 at 2:00 PM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Ok, I'll take a closer look, however I'm now struggling with similar problem:
>
> QE='0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}'
> print ${QE//'0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}'/°match°}
>
> the strings in QE and in …//'…'/… are identical. Why no match?
This looks like a bug in zsh. Here's a simpler test case:
% x='/'
% print -r -- ${x/'/'}
/
I expect the output to be empty but it's in fact "/".
This one also looks wrong:
% x=\'
% print -r -- ${x/'/'}
Here the output is empty while I expect a single quote.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author