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


Message #15 received at 52873-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Davide Brini <dave_br <at> gmx.com>
Cc: Martin Rixham <martin.rixham <at> equalexperts.com>, 52873-done <at> debbugs.gnu.org
Subject: Re: bug#52873: expr unexpected syntax error
Date: Wed, 29 Dec 2021 11:52:25 -0800
On 12/29/21 08:31, Davide Brini wrote:
> I think you need to use '+' before the offending token

Yes. That's a GNU extension. If you want to be portable to any POSIX 
implementation, you can use this instead:

expr "X(" : '.*' - 1

A similar example is given in the POSIX spec for 'expr':

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/expr.html

As this is not a bug, I'm closing the bug report.




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

Previous Next


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