Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

coloring a substitution



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