How to show zsh function definition (like bash “type myfunc”)?

前端 未结 4 890
陌清茗
陌清茗 2020-12-12 20:13

How do I show the definition of a function in zsh? type foo doesn\'t give the definition.

In bash:

bash$ function foo() { echo hello; }

bash         


        
4条回答
  •  孤街浪徒
    2020-12-12 20:47

    If you're not quite sure what you are looking for, you can type just

    functions
    

    and it will show you all the defined functions.

    Note that there are sometimes a LOT of them, so you might want to pipe to a pager program:

    functions | less
    

    to undefine a function, use

    unfunction functionname
    

提交回复
热议问题