bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function grammar


From: Chet Ramey
Subject: Re: function grammar
Date: Tue, 20 Jul 2010 21:38:29 -0400

> from man bash, to define a function use;
> 
> "function" "name" <compound-command>
>   OR
> "name" () <compound-command>
> 
> right?
> 
> And Compound Commands are:
> 
>   ( <list>)
>    { <list>; )
>   (( expression ))
>   [[ expression ]]
> ...et al....
> 
> so why do I get a syntax error for
> 
> function good_dir [[ -n $1 && -d $1 && -r $1  && -x $1 ]]
> 
> bash: syntax error near unexpected token `[['

Good catch.  This will be fixed in bash-4.2.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]