On Friday 25 September 2009 05:24:04 eatsubway wrote: > sry i have a stupid question. > > I have a variable and need to know how many items are in it. > > for example: > variable="abc xyz foo" > what program can i call to print out 3 > > right now im doing this... > > Counter() > { > echo $# > } > Counter $IDs > but that just seems stupid
Use an array, so you will even be able to store elements with spaces in them. -- D.