[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] update array index numbers?
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] update array index numbers? |
Date: |
Wed, 24 Jul 2013 12:51:14 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Wed, Jul 24, 2013 at 04:03:27PM +0000, adrelanos wrote:
> when unsetting items of an array, is it possible to update the index
> numbers?
If you want to reassign index numbers, the easiest way is to rewrite
the whole array:
a=("address@hidden")
Personally I'd avoid this whenever possible, and simply write the code
so that it correctly handles sparse arrays.