[Top][All Lists]

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

read -a ignores upper- and lowercase flags

From: Geir Hauge
Subject: read -a ignores upper- and lowercase flags
Date: Fri, 8 Apr 2016 12:03:39 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin14.5.0
Compiler: /usr/bin/clang
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='darwin14.5.0' -DCONF_MACHTYPE='x86_64-apple-darwin14.5.0' 
-DCONF_VENDOR='apple' -DLOCALEDIR='/opt/local/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H -DMACOSX   -I.  -I. -I./include -I./lib  
-I/opt/local/include -pipe -Os -DSSH_SOURCE_BASHRC -arch x86_64
uname output: Darwin MacGeir 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep  1 
21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin14.5.0

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


    read -ra var  doesn't change the casing of the strings it assigns
    when var has been declared with -l or -u.

    read without -a, and mapfile both work as expected.

    I also tested the latest devel branch to confirm the bug is still
    present there.


        declare -l a b c d
        a=( HEllO woRLd )
        read -r b <<< "HEllO woRLd"
        read -ra c <<< "HEllO woRLd"
        mapfile d <<< "HEllO woRLd"
        declare -p a b c d


        declare -al a=([0]="hello" [1]="world")
        declare -l b="hello world"
        declare -al c=([0]="HEllO" [1]="woRLd")
        declare -al d=([0]=$'hello world\n')

Geir Hauge

reply via email to

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