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

Re: bash vs. python scripts - which one is better?



On 2007-08-22 13:53:34 +0200, Vincent Lefevre wrote:
> Now, what about the following test, which does not test file existence?
> 
> vlefevre@vin:~$ [ true -a \( ! -a \) ] && echo OK
> bash: [: `)' expected, found ]
> vlefevre@vin:~$ /usr/bin/[ true -a \( ! -a \) ] && echo OK
> vlefevre@vin:~$
> 
> This is unspecified by POSIX, but test(1) has its own documentation.
> If you prefer, the bash builtin breaks the compatibility with test(1)
> even if it is non-standard.

Well, if fact, no need to use -a:

vlefevre@vin:~$ /usr/bin/[ \( ! -e \) ] && echo OK
vlefevre@vin:~$ [ \( ! -e \) ] && echo OK
bash: [: `)' expected, found ]

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



Reply to: