Re: Variable value in while loop

alex221_at_pisem.net
Date: 06/29/05


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/



Relevant Pages

  • Re: Why do CPUs run hotter...?
    ... chip makers started to make a real effort to make the chip go into a lower power state when this instruction is executed. ... A good description of what "HLT" should do is in the ACPI spec. ... Windows XP will use 'HLT' in its idle loop by default on an ACPI compliant system. ...
    (sci.electronics.design)
  • Re: [PATCH] add i386 idle notifier (take 3)
    ... Here is the latest version of the idle notifier for i386. ... This patch is against 2.6.20-rc1. ... add a notifier mechanism to the low level idle loop. ...
    (Linux-Kernel)
  • Re: [PATCH] add i386 idle notifier (take 3)
    ... Here is the latest version of the idle notifier for i386. ... add a notifier mechanism to the low level idle loop. ...
    (Linux-Kernel)
  • Re: Parsing a list of directories.
    ... >> I have been hammering away at awk try to solve this to no avail. ... isolating the number part of the directory names but getting ... a while read loop (perhaps via grep to filter out irrelevant ... Perhaps easier would be a "for x in *" loop ...
    (comp.unix.shell)
  • Re: magic /dev/null
    ... When I first used ftp command without input redirection inside ... a while loop shown as following, the while loop executed once and ... grep and awk since awk can search for or exclude patterns too. ...
    (comp.unix.shell)