Hi Gerrit,

On 2007-12-27 16:00:06 +0000, Gerrit Pape wrote:
> On Wed, Dec 12, 2007 at 02:18:47AM +0100, Vincent Lefevre wrote:
> > According to POSIX[*], "test \( ! -e \)" is a 4-argument test and is
> > here equivalent to "test ! -e". But dash (like ksh93 and bash) yields
> > an error:
> > 
> > $ test \( ! -e \) || echo $?
> > test: 1: closing paren expected
> > 2
> > $ test ! -e || echo $?
> > 1
> 
> Hi Vincent,
> 
> the -e switch to test takes an argument, a pathname.

According to POSIX, in both above examples, "-e" is *not* a switch,
just a string.

  test \( ! -e \)

means: return true if the string "-e" is empty, otherwhise return false.
The error in dash is that it incorrectly thinks that "-e" is a switch in
this context.

Regards,

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - 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)



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to