Tuesday, August 29, 2006

Listing the body of a Bash function

Everybody who knows something knows that typing "set" in bash(1) will list the values of all shell variables, aliases and functions.

But I wanted to find the definition of a function without having to "set | less" and manually looking for it in the output.

Turns out that typing "type " will give me what I wanted. Only "drawback" is that it also gives a line at the top saying " is a function", which is sort of good because it should allow some automatic way to know what to expect next.

No comments: