$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 是一款支持 functions** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款