[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What is $[ ] ?
From: |
Marc Herbert |
Subject: |
What is $[ ] ? |
Date: |
Tue, 23 Mar 2010 10:41:07 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3 |
Hi,
I could not find the dollar square brackets $[ ] expansion documented
in the manual. Is it the same as $(( )) ?
Cheers,
Marc
Le 22/03/2010 13:13, tbartdev@gmx-topmail.de a écrit :
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: linux-gnu
> Compiler: i686-pc-linux-gnu-gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
> -DHAVE_CONFIG_H -I. -I. -I./include -I./lib
> -DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
> -DSTANDARD_UTILS_PATH='/bin:/usr/bin:/sbin:/usr/sbin'
> -DSYS_BASHRC='/etc/bash/bashrc' -DSYS_BASH_LOGOUT='/etc/bash/bash_logout'
> -DNON_INTERACTIVE_LOGIN_SHELLS -DSSH_SOURCE_BASHRC -O2 -march=core2
> -mfpmath=sse -msse4.1 -fomit-frame-pointer -pipe
> uname output: Linux blackknight 2.6.31-gentoo-r6 #1 SMP PREEMPT Mon Nov 30
> 19:03:35 CET 2009 i686 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz
> GenuineIntel GNU/Linux
> Machine Type: i686-pc-linux-gnu
>
> Bash Version: 4.0
> Patch Level: 35
> Release Status: release
>
> Description:
> The man page seems to be wrong regarding the handling of numbers with
> different bases. It states one has to use [base#]n although it seems to be
> [base#n] that needs to be used...
> (I know I do not have the latest bash, but with 4.1 it is the same in the
> man page.)
>
> Repeat-By:
> blackknight ~ $ echo $[2#]10
> 010
> blackknight ~ $ echo $[2#10]
> 2
>
> Fix:
> Correct the man page
What is $[ ] ?,
Marc Herbert <=