bug-bash
[Top][All Lists]
Advanced

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

Re: Severe Bash Bug with Arrays


From: Linda Walsh
Subject: Re: Severe Bash Bug with Arrays
Date: Wed, 25 Apr 2012 16:18:21 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666



Ted Okuzumi wrote:

I am writing this e-mai to report to report a bug in bash

Description:
        Cannot redirect into an array from multiline variable

Does not work:
echo "$mydata" | while read line; do myarray+=( "$line" ); done

----
Have you tried this?


Ishtar:> a='this
 is
  a
   test'
Ishtar:> echo "$a"
this
 is
  a
   test
Ishtar:> readarray b < <(echo "$a")
Ishtar:> echo ${#b[*]}
4
Ishtar:> echo ${b[*]}
this is a test
Ishtar:> echo "${b[*]}"
this
  is
   a
    test

Ishtar:> echo -n "${b[*]}"
this
  is
   a
    test
Ishtar:> readarray -t b < <(echo "$a")
Ishtar:> echo "${b[*]}"
this  is   a    test
Ishtar:> echo ${b[*]}
this is a test
Ishtar:>

-------------

Seeems like you can have it anyway you want it...?

Does the above work for you?




reply via email to

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