Quote:
Originally Posted by Ygor
Try...
Code:
c=0
for i in *
do
test -f $i &&\
mv $i $(printf "FILE%03i" $c) &&\
((c+=1))
done
|
I tried this with a test directory of 17 Randomly named files. The result was sh: test: too many arguments 13 times and sh: test: Photo: binary operator expected 2 times. However, 2 of the files came out as expected: FILE002 and FILE003.
Sidenote: This is with .jpg files. I changed "FILE%03i" to "FILE%03i.jpg", so the two files came out: FILE002.jpg and FILE003.jpg. None of the other file names changed.