Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
coloring a substitution
- X-seq: zsh-users 28344
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: coloring a substitution
- Date: Tue, 8 Nov 2022 12:56:39 -0800
- Archived-at: <https://zsh.org/users/28344>
- List-id: <zsh-users.zsh.org>
I'm seeing if I can make my function 100% zsh native. The 'sed' works.
'$color' is just incrementing integers in a for loop starting at 31 (red):
recent[$aa]=$( print $recent[$aa] | sed -r
"s/$filter/\x1b\[$color;1m$filter\x1b\[0m/Ig" )
... so I'm trying to get zsh string replacement to do the same job:
recent[$aa]=${recent[$aa]/\x1b\[$color;1m$filter\x1b\[0m/}
... but it's not working, can it be repaired? I'll bet it can, it's
just a question of getting the backslashes right or some other tweak in
the grammar.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author