On 2022-11-10 10:36, Roman Perepelitsa wrote:
Correct. Anyway that's good to know, I think I've only used an associative array once and not here.Does that matter? I thought it was one of those situations where thedollar sign is optional.It matters if cc is an associative array. Given that you've (accidentally) used slice assignment with cc, it cannot be an associative array.
Ok, I'll play with that. Sheesh, the things I don't even know that I don't know. Is there somewhere I can read up on that?I've never heard of slice assignment :( These two aren't the same: cc[42]="foo bar" cc[42]=(foo bar) The second is a slice assignment.
You can filter beforehand like this:
cc=(${(M)cc:#*$filter*})
This assumes that $filter doesn't have metacharacters. If it does and
you want to treat them as such, use $~filter.
Thanks, I'll tinker with that. It will be satisfying to be able to
avoid sed ... come to that I just went back to grep for the filter and
colorization because sed's separation character might just be part of a
directory name. These little things! grep is faster too. But native
code will be best.
Roman.