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?
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?
With the type command:
dennis@lightning:~$ foo() { echo "hi"; }
dennis@lightning:~$ type foo
foo is a function
foo ()
{
echo "hi"
}
To get just the definition without "foo is a function",
$ declare -f foo
foo ()
{
echo "hi"
}