[Linux-programlama] Re: bashte integer expression expected hatasi

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Volkan YAZICI (yazicivo@ttnet.net.tr)
Date: Mon 27 Mar 2006 - 09:41:23 EEST


On Mar 26 08:16, Ali Metin wrote:
> #! /bin/bash
> counter=0
> for index in *
>
> do
> echo "File " $index
> let "counter +=1"
> if [ "$counter" -gt 50 ]
> then
> #mv $index ../
> ti=`ls -l $index | awk '{ print $5 }'`
>
> top=`expr $top+$ti`

Burada neden "let top+=$ti" denemiyorsunuz?

Ek olarak, önerim şu olacak:

SUM=0
for F in `find ./ -maxdepth 1 -printf "%h/%f:%b\n"`
do
    FPATH=`echo $F | awk -F ':' '{print $1}'
    FSIZE=`echo $F | awk -F ':' '{print $2}'
    ...
    let SUM+=$FSIZE
    ...
done

İyi çalışmalar.

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.