$functions  –  Mapping of Function Names to Definitions

$functions maps function names to their definitions. Adding or removing from this array will change the available functions in the shell environment.

Examples

Define and Unset a Function
1
2
3
4
5
6
7
say() { echo hello world; }
# print function definition
echo ${functions[say]}
# remove function definition
unset "functions[say]"
# attempt to use unavailable function
say
Output:
1
2
echo hello world
zsh: command not found: say
BashSupport Pro is a Zsh IDE with support for $functionstry it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal