bug-bash
[Top][All Lists]
Advanced

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

array subscripts act differently for integers(ie. let)


From: emanuelczirai
Subject: array subscripts act differently for integers(ie. let)
Date: Mon, 16 Feb 2015 03:04:49 +0100
User-agent: Roundcube Webmail


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-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin' -DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc' -DSYS_BASH_LOGOUT='/etc/bash.bash_logout' uname output: Linux manji 3.19.0-gbfa76d49 #28 SMP Mon Feb 9 14:29:14 CET 2015 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.3
Patch Level: 33
Release Status: release

Description:
when dealing with integer operations(let, ++), "bad array subscript" errors can happen because subscripts get unquoted (and evaluated even though they are in single quotes); unlike what happens when dealing with strings.

Repeat-By:
please see attached bash script to reproduce because that explains it much better than I could in words.

Thank you.

Attachment: subscripty_integer.bash
Description: Text Data


reply via email to

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