David Collier schrieb:
bash _allows_ the round brackets as in

func2 () {
}

but on further examination, they are apparently redundant syntax!!!!!

( If that's right, would it be reasonable to make ash ignore them too -
it would allow easier porting to ash from bash. )

I must admit I had mistakenly thought that the way of invoking functions
with parameters in bash required use of round brackets, but I now see it
isn't so.
Are you sure? From "man bash":
   [ function ] name () compound-command [redirection]
There is no indication of "()" being optional. Actually it would be interpreted as a call of "func2", followed by other statements, so it's not possible to define a function this way.

On the other hand, "help function" says:
   function name { COMMANDS ; } or name () { COMMANDS ; }
so "()" may be optional after the keyword "function".
Actually this contradicts each other, because according to the manual, "()" is required, while according to the help, it is not allowed.

Ralf Friedl

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to