Today I Learned

hashrocket A Hashrocket project

How to show a declared shell function

Today I learned how to see a function defined on my shell. Just use:

typeset -f my-func
# my-func ()
# {
#     echo "foobar";
# }

This command will displays the my-func implementation. This works for both bash and zsh.

If you want to show all functions at once you may want: typeset -f.

See More #command-line TILs