Re: Using unset to destroy array elements doesn't work with 'nullglob' s
From:
Greg Wooledge
Subject:
Re: Using unset to destroy array elements doesn't work with 'nullglob' set
Date:
Fri, 5 Jun 2009 12:05:21 -0400
User-agent:
Mutt/1.4.2.2i
On Fri, Jun 05, 2009 at 08:35:15AM -0700, Francis Moreau wrote:
> unset foo[0]
This is a problem in your script, unfortunately. Even without nullglob,
this can still fail if you happen to have a file named foo0 in your
current working directory, which would be matched as a glob.
For total safety, you must quote it:
unset 'foo[0]'