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

Truncate $functions



Hello,
tried functions=( a b ), set -A functions ( a b ), unset functions but
all don't truncate functions.

Test on IRC bot:

>> myf() { echo "test"; }; echo $parameters[functions]; unset functions; functions=( a b c d ); echo $parameters[functions]; echo ${#functions}
association-hide-hideval-special
association-hide-hideval-special
3

Maybe there is a way to do this? I would want to reload all functions,
first serializing them, with say declare -f. Unsetting function
entries one by one with "unset 'functions[entry]'" isn't fully
foolproof because functions named e.g. opp+a[ cannot be unset this
way.

Maybe there is a way to stop unset[$i] with i='opp+a[ ' from stopping
script? I would then fallback to define the function as empty.

Best regards,
Sebastian Gniazdowski



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