Re: stupid shell tricks again

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Craig White
Date:  
To: plug-discuss
Subject: Re: stupid shell tricks again
On Mon, 2004-03-22 at 15:13, Jeremy C. Reed wrote:
> On Mon, 22 Mar 2004, Craig White wrote:
>
> > I'm now up to ...
> > for i in `cut -f1 $wdirect/users-homes`; do result=$(( $size_plateau -
> > $i )); if (($result<=0)); then `echo $i`; fi; done
> >
> > so it's time to use the grep thought that Jeremy had
>
> I'd do something like:
>
> du -sh /home/* | while read line ; do
>  i=`echo $line | cut -f1` ;
>  if [ $i -gt $size_plateau ] ; then
>    echo $i for `echo $line | cut -f2 | xargs -n 1 basename`
>  fi
> done

>
> (not tested)
>

---
BTW - thanks (and Rowan too)

and the math thing doesn't work if you use du -sh (human readable)
because you would have to add another eval for G or K and that's stupid.
I never entertained that but it came up with Rowan's suggestion and I
replied not thinking that anyone would actually carry it through.

Craig

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss