Hello,
Ian Shields wrote:
I guess the most important thing is that Bash doesn't support function
nesting. Try entering the whole thing in Bash and the run f1. Also try
recalling the function and press enter.
Have you tried that yourself? I did that and this is what happens:
---------------------8<--------------------------------------
$ echo $BASH_VERSION
3.1.17(1)-release
$ f1() { f2() { echo "Function "f2", inside "f1"."; }; }
$ f2
bash: f2: command not found
$ f1
$ f2
Function f2, inside f1.
$ _
---------------------8<--------------------------------------
that means you can define a function inside of a function and make that
nested function globally available. In other words a function
can define a function. I only wanted to point out that the
quoting in f2() is rather useless, it should probably look like:
echo "Function 'f2', inside 'f1'."
Regards,
Peter
_______________________________________________
lpi-discuss mailing list
[email protected]
http://list.lpi.org/cgi-bin/mailman/listinfo/lpi-discuss