Can I set up my own sub-environment?

Paul Smith paul at mad-scientist.net
Tue Feb 8 14:37:22 UTC 2011


On Tue, 2011-02-08 at 12:40 +0000, David Collier wrote:
> Ah.... I've had another look at this
> 
> bash _allows_ the round brackets as in
> 
> func2 () 
> {
> }
> 
> but on further examination, they are apparently redundant syntax!!!!!

I'm not sure what you mean.  The parentheses are definitely NOT
redundant; you cannot leave them off.  Without them you don't have a
function definition, not in any POSIX-based shell (including bash)
anyway.

        ~$ foo { echo bar; }
        bash: syntax error near unexpected token `}'
        ~$ foo () { echo bar; }
        ~$ foo
        bar




More information about the busybox mailing list