Code: Select all
index=0
for file in `find`
do
echo $index $file
index=`expr $index + 1`
done
Code: Select all
-rw-r--r-- 1 root root 2 2007-10-02 11:56 bar
-rw-r--r-- 1 root root 2 2007-10-02 11:56 foo
-rw-r--r-- 1 root root 2 2007-10-02 11:57 foo barCode: Select all
0 .
1 ./foo
2 ./bar
3 ./foo
4 barThe normal output of find will be able to distinguish by using a newline, can i parse that into an array somehow?
Code: Select all
.
./foo
./bar
./foo bar