[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to know the number of items of a list ?
From: |
Cyril Chevrot |
Subject: |
How to know the number of items of a list ? |
Date: |
1 Nov 2001 06:51:27 -0800 |
I want to know how we can know the number of items of a list.
I need to know this number in a loop. So I am oblige to do
2 loop : one to calculate this number, the other to use this
number.
I would like to make only one loop.
Is it possible ?
-----------------------------
count=0
for var in `ls *`; do
count=`expr $count + 1`
done
for var in `ls *`; do
...
... $count ...
...
done
------------------------------
Thanks in advance
--
Cyril
- How to know the number of items of a list ?,
Cyril Chevrot <=