[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Arithmetic expansion bug.

From: Isaac Marcos
Subject: Arithmetic expansion bug.
Date: Sat, 10 Feb 2018 15:57:20 -0400


There is a bug when expanding this math:

    $ echo "$((~0))"
    bash: /home/user: syntax error: operand expected (error token is

It works correctly when an space is added:

    $ echo "$(( ~0 ))"

Bash version:

    $ echo "$BASH_VERSION"

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib  -Wdate-time
-D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/bash-7fckc0/bash-4.4=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall -no-pie
-Wno-parentheses -Wno-format-security
uname output: Linux IO.iafcg.priv 4.14.0-3-amd64 #1 SMP Debian 4.14.13-1
(2018-01-14) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.4
Patch Level: 12
Release Status: release

Cases are always threesome:
Best case, Worst case, and Just in case

reply via email to

[Prev in Thread] Current Thread [Next in Thread]