All pastes #715413 Raw Edit

Someone

public text v1 · immutable
#715413 ·published 2007-09-26 08:39 UTC
rendered paste body
#inside my exceedlist file
aagarcia /home/aagarcia/Maildir/new
crmagsalay /home/crmagsalay/Maildir/new
gabalase /home/gabalase/Maildir/new
rmbalquin /home/rmbalquin/Maildir/new


#my removequota.script below.. above lists is manually checked that all of them are above 30000kilobytes
#but still my code below read only every other line and not the whole line when running through if statement
#if [ -d "$userdir1" ] if it goes inside this statement it skip every other line and 
#even if passing through this if [ $usage -lt 300000 ] statement still the same result..it reads every other line

#!/bin/bash
cat /root/.quotadir/exceedlist | while read usermail1 userdir1 ;
do
                if [ -d "$userdir1" ]
                then
                        usage=$(du /home/"$usermail1"/Maildir |tail -1 |awk '{print $1}')
                        echo "usage = $usage username: $usermail1   directory: $userdir1"
                       if [ $usage -lt 300000 ]
                        then
                                /bin/chown "$usermail1" "$userdir1"
                                echo "$usermail1" >>//root/.quotadir/lessquota
                                echo "press enter key to continue unsetting quota"
                                read hoi
#                        fi
                fi       
done
for i in `cat /root/.quotadir/lessquota`        
do
                /bin/sed "/\<$i\>/d" /root/.quotadir/exceedlist >/root/.quotadir/tmpexceed
                mv -f /root/.quotadir/tmpexceed /root/.quotadir/exceedlist
done