[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unsetting all elements of an associative array
From: |
isabella parakiss |
Subject: |
Unsetting all elements of an associative array |
Date: |
Wed, 4 Feb 2015 09:12:12 +0100 |
I'm trying to use unset array[@] to empty an associative array, but something
goes wrong.
This behaves as expected:
$ declare -A array; array[path/directory]=value
This produces an error:
$ declare -A array; unset array[@]; array[path/directory]=value
bash: path/directory: division by 0 (error token is "directory")
After unsetting all its elements, the array is not associative anymore?
Using array=() empties the array correctly.
- Unsetting all elements of an associative array,
isabella parakiss <=
Re: Unsetting all elements of an associative array, konsolebox, 2015/02/04