GNU bug report logs - #28461
erreurs

Previous Next

Package: coreutils;

Reported by: Eric Mariaud <eric.mariaud <at> gmail.com>

Date: Thu, 14 Sep 2017 17:46:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Assaf Gordon <assafgordon <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#28461: closed (erreurs)
Date: Thu, 14 Sep 2017 18:02:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 14 Sep 2017 12:00:53 -0600
with message-id <2def9484-83b3-bb8a-536a-88c3e4465798 <at> gmail.com>
and subject line Re: bug#28461: erreurs
has caused the debbugs.gnu.org bug report #28461,
regarding erreurs
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
28461: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28461
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eric Mariaud <eric.mariaud <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: erreurs
Date: Thu, 14 Sep 2017 19:43:03 +0200
[Message part 3 (text/plain, inline)]
Bonjour

voici le résultat des commandes que me retourne mon terminal, Xubuntu 14.04


eric <at> Eric-Xub:~/Bureau$ expr 2 + 3
5
eric <at> Eric-Xub:~/Bureau$ expr 2 * 3
expr: erreur de syntaxe
eric <at> Eric-Xub:~/Bureau$

Cordialement
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Assaf Gordon <assafgordon <at> gmail.com>
To: Eric Mariaud <eric.mariaud <at> gmail.com>, 28461-done <at> debbugs.gnu.org
Subject: Re: bug#28461: erreurs
Date: Thu, 14 Sep 2017 12:00:53 -0600
tag 28461 notabug
stop

Hello,

On 2017-09-14 11:43 AM, Eric Mariaud wrote:
> eric <at> Eric-Xub:~/Bureau$ expr 2 + 3
> 5
> eric <at> Eric-Xub:~/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.

Add single-quotes around the '*' character to send it as-is to 'expr':

    $ expr 2 '*' 3
    6

Alternatively,
Most modern shells support built-in basic arithmetic using
the '$(())' syntax (dollar-sign and two parentheses):

    $ echo $((2*3))
    6


As such, I'm marking this as not-a-bug, but discussion can continue by
replying to this thread.

regards,
 - assaf



This bug report was last modified 7 years and 240 days ago.

Previous Next


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