On 12/23/15 1:49 AM, James Thomas Moon wrote:
> The following script is okay
>
> set -ue
> readonly -a a=('')
>
> Yet, the following script fails with exit code 1
>
> set -ue
> readonly -a a=()
>
> In my case, I would like to preserve a copy of all passed arguments:
>
> set -ue
> readonly -a ARGS=("${@}")
>
> If no arguments are passed then the script fails. It's surprising the
> error behavior diverges depending upon setting an empty array or non-empty
> array.
I can't reproduce this in any bash version going back to bash-2.05b.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/