autoconf
[Top][All Lists]
Advanced

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

Re: AS_DIRNAME and expr


From: Paul Berrevoets
Subject: Re: AS_DIRNAME and expr
Date: Wed, 29 Nov 2000 07:27:38 -0500

Akim Demaille wrote:

> [...]
>
> expr foo : 'bar\(\)'
>
> I was expecting the later to return indeed the empty string.  I'll
> have to reread the whole thread, because I don't remember if someone
> showed a case where `0' is output.
>
> I can't believe that some expr would answer `0' to
>
> expr foo : 'foo\(\)'
>
> but I'd appreciate if someone could try on her host :)

I used to have this on hppa1.1-hp-hpux10.20 and hppa1.1-hp-hpux11.?? until
we recently installed a patch to correct the problem.

> Finally, what I was suggesting was to use the empty string itself as
> fall back, hoping that it would erase the 0.
>
> | but beware that this behaves on different machines:
> | solaris$ expr foo : '\(bar\)' \| a : 'a\(\)
> | 0
>
> here I was suggesting
>
> expr foo : '\(bar\)' \| ''
>
> and hoped we'd get a empty output instead of 0.
>
> [...]
>
> But then, maybe the problem is just very simple: isn't it just the
> empty string which evaluates to 0?  I mean, could you try this on your
> solaris?
>
>         expr ''

solaris$ expr ''

solaris$ expr foo : bar \| ''
0
solaris$ expr foo : bar \| this
this

hp-ux$ expr ''

hp-ux$ expr foo : bar \| ''

hp-ux$ expr foo : bar \| this
this
--
Paul Berrevoets




reply via email to

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