Hi Chet thanks for your answer, I understand then that unset "my_array[0]" works and therefore quoting the argument is the proper way for using unset.
Regards Mario On Wed, Sep 24, 2008 at 11:41:56PM -0400, Chet Ramey wrote: > [EMAIL PROTECTED] wrote: > > > Bash Version: 3.2 > > Patch Level: 39 > > Release Status: release > > > > Description: > > When nullglob option is enable (shopt -s nullglob), unset of an array > > does not work. > > You're right; it does. `unset' is a builtin, so all of the shell's word > expansions are performed before it is run, including globbing. If you > don't protect the argument by quoting it, the nullglob extension will > remove it when there are no matching filenames. Running the script with > `bash -x' will show what's happening. > > There's no `fix' -- everything is working as it's supposed to. You've > just combined things in a way that produces unexpected results. > > Chet > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > > Chet Ramey, ITS, CWRU [EMAIL PROTECTED] > http://cnswww.cns.cwru.edu/~chet/