[SLUG] how to clear out bash array

From: Mike Branda (mike@wackyworld.tv)
Date: Tue Aug 15 2006 - 17:35:17 EDT


So I've been reading some tutorials on bash arrays and have managed to
figure out how to create one and enter lines from a while loop in to it
via:

dynamicvararr[${#dynamicvararr[@]}]=$formatted_line

set inside the loop. I can echo out the values stored in the array
with

echo ${dynamicvararr[@]}

My question is that I can't find out how to reset the array to an
"empty" state for the next time the loop is executed with different
information being fed in via $formatted_line. It just keeps adding to
the end of the array. Does anybody know how to clear it out / reset it
after the loop exits?

TIA.

Mike Branda Jr.

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:03:18 EDT