bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Real easy questions. Please answer


From: Dave B
Subject: Re: Real easy questions. Please answer
Date: Fri, 25 Sep 2009 09:06:31 +0100
User-agent: KMail/1.11.2 (Linux/2.6.28-15-generic; KDE/4.2.2; x86_64; ; )

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]