Re: [SLUG] how to clear out bash array

From: Logan Tygart (thelogan@allyourbase-arebelongto.us)
Date: Tue Aug 15 2006 - 17:51:06 EDT


On Tue, 2006-08-15 at 17:35 -0400, Mike Branda wrote:
> 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?

unset dynamicvararr

Might be getting close to Perl time.

The Logan

-- 
War is God's way of teaching Americans about geography. -- Ambrose Bierce
Registered Linux User: 277727


----------------------------------------------------------------------- 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:24 EDT