bug-bash
[Top][All Lists]
Advanced

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

Re: left bit shift (<<) operator now demands line continuation


From: Roman Rakus
Subject: Re: left bit shift (<<) operator now demands line continuation
Date: Thu, 28 Jan 2010 16:04:24 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-3.fc11 Lightning/1.0pre Thunderbird/3.0

On 01/27/2010 08:34 PM, jwm@horde.net wrote:
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../bash -I../bash/include -I../bash/lib   -g -O2 -Wall
uname output: Linux boost 2.6.31-17-server #54-Ubuntu SMP Thu Dec 10 18:06:56 
UTC 2009 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

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

Description:
bash 4.0 fails to parse a function that's parsed successfully by dash(1) as
well as older versions of bash (3.1, 3.2):

[jwm@boost:pts/6 ~>  cat inet
swap32_posix()
{
        local funcname=swap32_posix
        local arg
        for arg in "$@"; do
                echo $((
                        ($arg&  4278190080)>>  24 |
                        ($arg&  16711680)>>  8 |
                        ($arg&  65280)<<  8 |
                        ($arg&  255)<<  24
                ))
        done
}
[jwm@boost:pts/6 ~>  bash -n inet
inet: line 6: unexpected EOF while looking for matching `)'
inet: line 14: syntax error: unexpected end of file
[jwm@boost:pts/6 ~>  dash -n inet
[jwm@boost:pts/6 ~>


Repeat-By:
This affects the *left* bit shift operator, but *not* the right bit shift
operator:

[jwm@boost:pts/6 ~>  cat left.sh
echo $((2<<  1
))
[jwm@boost:pts/6 ~>  bash -n left.sh
left.sh: line 1: unexpected EOF while looking for matching `)'
left.sh: line 3: syntax error: unexpected end of file
[jwm@boost:pts/6 ~>  cat right.sh
echo $((1>>  2
))
[jwm@boost:pts/6 ~>  bash -n right.sh
[jwm@boost:pts/6 ~>


4.1.2(1)-release is also affected
RR




reply via email to

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