问题
I'd like to list the currently defined functions in dash
. Is there any way of doing that?
The closest I've been able to come up with is type
which can be used to test if a function exist, but other than that I'm stumped.
P.S. I'm talking about dash
here (not bash
or zsh
).
回答1:
Looking at exec.c it seems that no, there is none - the table is static, there's no such functionality in the file and none of the exported functions (unsetfunc etc) appear to offer the possibility of iterating, so unless I missed something I'd say you'll need to write a patch :)
来源:https://stackoverflow.com/questions/24868745/list-currently-defined-functions-in-dash