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

Re: associative array questions




On 2022-12-13 08:22, Roman Perepelitsa wrote:
eval 'list=( "${(@M)list:#(#i)*$SEARCHBUF*}" )'     # filter the array.

This eval will expand things that you don't want expanded. Use `set -A $list` instead.

Roman.

I think I'm missing something Roman,  can't make it work.  Tried a few variations:

set -A $list=( "${(@M)list:#(#i)*$SEARCHBUF*}" )
set -A $list=( "${(@M)${(P)list}#(#i)*$SEARCHBUF*}" )
set -A $list=( "${(@M)${(P)1}#(#i)*$SEARCHBUF*}" )

BTW is it possible to redirect the error messages and especially 'set -x' output?  All this is with zcurses active so the messages are hidden or chopped up.




Messages sorted by: Reverse Date, Date, Thread, Author