Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
modify or delete variable
- X-seq: zsh-users 29780
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: modify or delete variable
- Date: Sat, 6 Apr 2024 07:57:27 -0700
- Archived-at: <https://zsh.org/users/29780>
- List-id: <zsh-users.zsh.org>
var=( ${(M)var:#*(#i)$substring*} )
var=(
${var//(#bi)($substring)/aaa${match[1]}bbb )
... can those to operations be combined? If a string exists in a
variable, modify it, else delete it? I'm betting yes. Mind,
there's nothing wrong with two easy to understand steps even if a
microsecond might be saved by combining them.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author