Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
histsubstpattern in zmv
- X-seq: zsh-workers 51814
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: histsubstpattern in zmv
- Date: Thu, 1 Jun 2023 19:35:56 +0100
- Archived-at: <https://zsh.org/workers/51814>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
The csh-style ${var:s/foo/bar} is often more legible and easy
to cumulate than the Korn-style equivalent ${var/foo/bar}
Compare:
${${(L)var//[[:blank:]]/_}//\/foo[^/]#}
with:
${var:l:gs/[[:blank:]]/_:gs|/foo[^/]#|}
The csh-style also has :& to repeat.
But that needs set -o histsubstpattern and in zmv, emulate -LR
zsh resets options.
Would it be possibe to enable it in zmv along with extendedglob
which is already enabled there, or if not allow the user to enable it,
or maybe even better introduced some :+s/pattern/repl/
:-s/string/repl/ or :S/pattern/replacement/ so we can use both
at the same time, like ${f:gs/***/3-stars/:gS/???/any-3-chars} ?
Thanks,
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author