bug-bash
[Top][All Lists]
Advanced

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

Re: nullglob breaks unset of arrays


From: Chris F.A. Johnson
Subject: Re: nullglob breaks unset of arrays
Date: Thu, 25 Sep 2008 21:47:44 +0000
User-agent: slrn/0.9.8.1 (Linux)

On 2008-09-24, mario.trentini_bb@m4x.org wrote:
...
> Description:
>       When nullglob option is enable (shopt -s nullglob), unset of an array
>       does not work.
>
> Repeat-By:
>       my_array=(1 2 3 4 5 6)
>       echo "Array ${my_array[@]}"
>       shopt -u nullglob
>       # remove first entry
>       unset my_array[0]
>       echo "Array ${my_array[@]}"
>       shopt -s nullglob
>       # remove first entry
>       unset my_array[0]

   There is no longer any my_array[0] to unset. Try:

unset my_array[1]

>       echo "Array ${my_array[@]}"


-- 
   Chris F.A. Johnson, webmaster         <http://Woodbine-Gerrard.com>
   ===================================================================
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


reply via email to

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