How to print a function definition in Bash?
declare -f gpm
will just print the function definition of function gpm
with no other text.
EDIT: The best answer isn't this one, but the other one below.
What this answer used to say is that you can get a function definition in bash using the type
builtin, e.g. type gpm
. However, using declare
as described in the other answer is better in every way.