Ubuntu – How to print/recall the definition of a function in bash

bashenvironment-variablesfunctions

I can define and print the contents of variable called my_var like this:

my_var="hello"
echo $my_var

but if I define:

my_funct {echo "hello";}

how can I recall my function's definition later on?

Best Answer

With the type command:

dennis@lightning:~$ foo() { echo "hi"; }
dennis@lightning:~$ type foo
foo is a function
foo () 
{ 
    echo "hi"
}
Related Question