Array Length Reports as Having Length when it is Empty?

view story

http://www.unix.com – Hello All, I have this script that does stuff like "starting, stopping & restarting" a Daemon Process running on my machine... My main question is why in part of my code (which you will see below) does the Array Length (i.e. ${#PIDS[@]} ) return "1" when I know the Array is empty..? Here is a little explaination of the problem... Occasionally when runnning the "ps auxww" command the output finds more than one instance of the Daemon. Because of this I save the PID(s) into an array (which is declared at the start of the script), then inside a function I save (HowTos)