I often face syntax errors on expr when running configure scripts. I wrote a set of tests on Linux to try to identify the cause. I found one : normally "expr 2 \* 6" should work and give "12" but a syntax error happens.
I can provide the sh script that contains all the cases I grouped in, with the expected values (using Linux as reference).
Bug in command expr
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Bug in command expr
I'm sure I've read about this issue before, did you allready post something? or maybe someone else posted it....
Anyway yes I've reproduced the bug in expr, I'm not sure of the status of coreutils though WRT the SDK ie whether it's a contribution or not. If it's a contribution you'll need to send you're bug report to the maintainer (who I think is Henning Nielsen Lund)
Anyway yes I've reproduced the bug in expr, I'm not sure of the status of coreutils though WRT the SDK ie whether it's a contribution or not. If it's a contribution you'll need to send you're bug report to the maintainer (who I think is Henning Nielsen Lund)
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Bug in command expr
Having checked with the powers that be, about coreutils status in the SDK, I've opened a bug for it
Bug 7231
Thanks for the report.
Bug 7231
Thanks for the report.
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Bug in command expr
BTW i f you'd like to attach that test script, it may well be of use.
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Bug in command expr
A work arround for expr may be achieved by setting
set DISABLE_COMMANDLINE_WILDCARD_EXPANSION 1
however this may break other aspects of a configure script (untested)
set DISABLE_COMMANDLINE_WILDCARD_EXPANSION 1
however this may break other aspects of a configure script (untested)
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: Bug in command expr
A further update on how to fix this with the current SDK
It's an undocumented feature of abc-shell that setting DISABLE_COMMANDLINE_WILDCARD_EXPANSION will disable command wildcard expansion of clib2 based coomands such as those included in coreutils. Abc-shell handles this expansion itself so further expansion is not necessary and creates the bug you see.
So for correct operation either set an amigaos golbal variable with setenv
ie
setenv DISABLE_COMMANDLINE_WILDCARD_EXPANSION 1
or add
export DISABLE_COMMANDLINE_WILDCARD_EXPANSION=1 to your
.abcrc
file in HOME:
or
to the file
SDK:Data/abc-shell/variables
It's an undocumented feature of abc-shell that setting DISABLE_COMMANDLINE_WILDCARD_EXPANSION will disable command wildcard expansion of clib2 based coomands such as those included in coreutils. Abc-shell handles this expansion itself so further expansion is not necessary and creates the bug you see.
So for correct operation either set an amigaos golbal variable with setenv
ie
setenv DISABLE_COMMANDLINE_WILDCARD_EXPANSION 1
or add
export DISABLE_COMMANDLINE_WILDCARD_EXPANSION=1 to your
.abcrc
file in HOME:
or
to the file
SDK:Data/abc-shell/variables
Re: Bug in command expr
broadblues : First, thank you for the support, for having opened the bug and the proposals.
The script I used to test various cases using expr is here.
I could try to write to modify it using Ruby and its test builtin features.
The script I used to test various cases using expr is here.
I could try to write to modify it using Ruby and its test builtin features.