GNU bug report logs - #52873
expr unexpected syntax error

Previous Next

Package: coreutils;

Reported by: Martin Rixham <martin.rixham <at> equalexperts.com>

Date: Wed, 29 Dec 2021 16:14:02 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Davide Brini <dave_br <at> gmx.com>
To: 52873 <at> debbugs.gnu.org
Subject: bug#52873: expr unexpected syntax error
Date: Wed, 29 Dec 2021 17:31:31 +0100
On Wed, 29 Dec 2021 12:42:24 +0000, Martin Rixham
<martin.rixham <at> equalexperts.com> wrote:

> I'm getting an error from the following:
>
>     [martin <at> fedora ~]$ expr ')' : '.*'
>     expr: syntax error: unexpected ')'
>
> There also seems to be a similar problem with:
>
>     expr '(' : '.*'

I think you need to use '+' before the offending token, at least according
to the man page:

       + TOKEN
              interpret TOKEN as a string, even if it is a
              keyword like 'match' or an operator like '/'

And indeed:

$ expr '+' ')' : '.*'
1

--
D.




This bug report was last modified 3 years and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.