I have to ask you this because its driving me crazy since too many days.
I will explain my problem with an example:
s1="aa a"
s2="bbb"
s3="ccc"
s4="ddd"
v=($s1 $s2 $s3 $s4)
echo ${v[0]}
echo ${v[1]}
echo ${v[2]}
echo ${v[3]}
echo ${v[4]}
The output is:
aa
a
bbb
ccc
ddd
My problem is that v[0]
contains "aa"
and v[1]
contains "a"
. I don't get why v[0]
is not "aa a"
.
My output should be:
aa a
bbb
ccc
ddd
...and v[4]
should be empty
Why does the space create this problem?