[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sub-arrays do not work with non-blank IFS
From: |
Jan Schampera |
Subject: |
Re: Sub-arrays do not work with non-blank IFS |
Date: |
Tue, 29 Jan 2008 20:33:30 +0100 |
User-agent: |
IceDove 1.5.0.14pre (X11/20071018) |
Lea Wiemann wrote:
> Repeat-By:
>
> IFS=$'\n'
> a=(A B C D)
> b=("${a[@]}")
> echo "${#b[@]}", "${b[@]}" # 4, A B C D -- OK
> b=("${a[@]:2}")
> echo "${#b[@]}", "${b[@]}" # 1, C D -- bug, should be 2, C D
I have to correct myself, in the normal case "${a[@]:2}" will expand
indeed word-wise. So it's a bug.
Sorry,
Jan