[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52873: expr unexpected syntax error
From: |
Paul Eggert |
Subject: |
bug#52873: expr unexpected syntax error |
Date: |
Wed, 29 Dec 2021 11:52:25 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 |
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.