[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28461: erreurs
From: |
Bernhard Voelker |
Subject: |
bug#28461: erreurs |
Date: |
Fri, 15 Sep 2017 07:45:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
On 09/14/2017 08:00 PM, Assaf Gordon wrote:
> On 2017-09-14 11:43 AM, Eric Mariaud wrote:
>> address@hidden:~/Bureau$ expr 2 + 3
>> 5
>> address@hidden:~/Bureau$ expr 2 * 3
>> expr: erreur de syntaxe
>
> The asterisks ( * ) character has special meaning on the shell,
> which you can observe by comparing the output of:
>
> echo 2 + 3
> vs
> echo 2 * 3
>
> Technically, the shell replaces the '*' character with the list of
> all files in the current directory. The 'expr' program never sees it.
Well, we could try to improve the error diagnostics. I see in
the code that expr returns "syntax error" without any more explanation
in several places. It could at least say what it would expect or
not expect in that place.
And finally - when it comes to shell pattern globbing - it could
do an extra check if the offending argument is an existing file
similar to latest 'find' [1]:
$ touch a b c
$ ../find/find -name *
find: paths must precede expression: `b'
find: possible unquoted pattern after predicate `-name'?
[1] https://git.sv.gnu.org/cgit/findutils.git/commit/?id=9530e31f6d
WDYT?
Thanks & have a nice day,
Berny
- bug#28461: erreurs, Eric Mariaud, 2017/09/14
- bug#28461: erreurs, Assaf Gordon, 2017/09/14
- bug#28461: erreurs,
Bernhard Voelker <=
- bug#28461: erreurs, Assaf Gordon, 2017/09/15
- bug#28461: erreurs, Pádraig Brady, 2017/09/15
- bug#28461: erreurs, Jim Meyering, 2017/09/15
- bug#28461: erreurs, Pádraig Brady, 2017/09/16
- bug#28461: erreurs, Assaf Gordon, 2017/09/17
- bug#28461: erreurs, Jim Meyering, 2017/09/17
- bug#28461: erreurs, Assaf Gordon, 2017/09/20
- bug#28461: erreurs, R0b0t1, 2017/09/16
- bug#28461: erreurs, Bernhard Voelker, 2017/09/16