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

modify or delete variable



    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