Cumartesi, Nisan 01, 2006

Filesize

counter=0
top=0
p=1
for index in *.wma ## * is replaced by all files in the current directory

do
echo "File " $index ## $index is the name of the current word
let "counter +=1"
#if [ "$counter" -gt 50 ]
# then
#mv $index ../
ti=`ls -l $index | awk '{ print $5 }'`
#b=`expr match $ti [0-9]*`
#a=`echo " scale 1; $ti " | bc`
#a=stat $index | grep Size | awk '{ print $2}'

#top=`expr $top+$ti`
let "top +=$ti"
echo $top "\n"
if [ "$top" -gt "692000000" ]
then
#mv $index cd$p/
#echo $p $top
let "top =0"
let "p +=1"
echo $p "p"
fi

mv $index cd$p/

# fi
done
echo $p
#echo "sayi" $counter $ti

Hiç yorum yok: