Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Why do we need to quote # in ${(#):-2\#1011010} ?
- X-seq: zsh-workers 49409
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Why do we need to quote # in ${(#):-2\#1011010} ?
- Date: Sun, 12 Sep 2021 09:11:51 +0100
- Archived-at: <https://zsh.org/workers/49409>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
$ echo ${:-2#1011010}
2#1011010
That # is fine when not quoted there, so why:
$ echo ${(#):-2#1011010}
$ echo ${(#):-2\#1011010}
Z
?
It seems to discard everything after the expansion within the word:
$ echo before${(#):-2#1011010}"hey, where did that go?" other args
before other args
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author