Suppose I source the function myfunction
defined by
myfunction(){
myinnerfunction
}
where myinnerfunction
is defined as
myinnerfunction(){
echo word
}
I'd like to find an equivalent of declare -f myfunction
that displays the content of the inner function myinnerfunction
, i. e.
myfunction ()
{
echo word
}
instead of
myfunction ()
{
myinnerfunction
}
Now, what if I have inner aliases instead of inner functions?
declare -f
for the inner function. To explain, Bash treats functions just like any other command; e.g. you couldunset -f myinnerfunction
then put a scriptmyinnerfunction
in your PATH and it would work exactly the same.