Re: Variable value in while loop
alex221_at_pisem.net
Date: 06/29/05
- Next message: Greg Beeker: "Re: AWK or otherway to convert transpose Columns to Rows"
- Previous message: Bill Marcum: "Re: using find"
- In reply to: Bill Marcum: "Re: Variable value in while loop"
- Next in thread: Bill Seivert: "Re: Variable value in while loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Jun 2005 10:34:20 -0700
I see now. While loop may break having not exhausted all the output
produced by the awk. (when we already freed enough space). I thought of
two ways doing away with this. One is to ignore these errors (but how
correct is that). The other is something like this
flag=0
while read size fname; do
[ $flag = 0 ] && echo -n "deleting $fname, size=$size"
[ $flag = 0 ] && rm -f $fname
[ $flag = 0 ] && ((sum=sum+size))
[ $flag = 0 ] && ((total_deleted=total_deleted+1))
[ $flag = 0 ] && echo " total freed=$sum"
((sum>bytes_to_free)) && flag=1
done
But this may run idle and influence performance (?) in case there are
many files in ./Storage/
- Next message: Greg Beeker: "Re: AWK or otherway to convert transpose Columns to Rows"
- Previous message: Bill Marcum: "Re: using find"
- In reply to: Bill Marcum: "Re: Variable value in while loop"
- Next in thread: Bill Seivert: "Re: Variable value in while loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|