Hi, when I define the following function:
$ function foo {
> echo bar
> }
and try to run it, I get:
$ foo
bar
but try to print its definition with "declare", I get:
$ declare -p foo
bash: declare: foo: not found
$ declare -pf foo
bash: declare: foo: not found
$declare -pF foo
bash: declare: foo: not found
but try to print its definition with "type", I get:
$ type foo
foo is a function
foo ()
{
echo bar
}
I'm running the above commands in the following environment:
* Fedora Linux 20 "Heisenbug"
* BASH_VERSION => 4.2.53(1)-release
* bash --version => GNU bash, version 4.2.53(1)-release
(x86_64-redhat-linux-gnu)
Any clue why the declare built-in does not print a function's definition?
BR
Tim
signature.asc
Description: OpenPGP digital signature
