help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Wrong result for assign subarray to itself?


From: Qu Wenruo
Subject: [Help-bash] Wrong result for assign subarray to itself?
Date: Mon, 10 Nov 2014 17:31:44 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Hi all,

A strange behavior happens like the following:
---
$ words=('word1' 'word2' 'word3')
$ echo address@hidden
word1 word2 word3            # OK
$ address@hidden:1}
$ echo address@hidden
word2 word3 word2 word3  # What happens here??!!
# Shouldn't the result be ('word2' 'word3') ??
---

Any clue why this happens?

BTW, if using any variant, nothing strange will happen.
---
$ words=('word1' 'word2' 'word3')
$ echo address@hidden
word1 word2 word3            # OK
$ address@hidden:1}
$ echo address@hidden
word2 word3                        # Also OK
---

Thanks,
Qu



reply via email to

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