How about something like:
du -sb ./*|sort -g|tail|sed 's/\.\///'|awk '{print $2}'
to get the names... and then wrap it up in a mail command... it's not a
"bash" script since it forks a few times, but it's a quick'n'dirty.
Ben
On Mon, 22 Apr 2002, Brian Chabot wrote:
> Hey, all -
>
> I'm attempting to write a script to put in cron.weekly that will find
> the 25 users who use the most disk space and email them a warning.
>
> My relatively simple question is:
>
> Is there anything in bash that is the equivelent to the old basic
> mid/left/right way of cutting down a variable? If I have a line from
> the du output, basically I'm trying to define a variable for the
> corresponding username (in other words, given: "1234M /home/USER" I want
> 'USER" so as to then turn around and email that user. (I already have
> way of removing non-user directories in /home).
>
> Any thoughts?
>
> Oh, and this is fora RH7.2 system and really does not need to be all
> that portable.
>
>
> Thanks,
>
> Brian
>
> ---------------------------------------------------------------
> | [EMAIL PROTECTED] Spam me and DIE! |
> | http://www.datasquire.net |
> | Co-Founder & Co-Owner of |
> | Data Squire Internet Services |
> ---------------------------------------------------------------
>
>
> *****************************************************************
> To unsubscribe from this list, send mail to [EMAIL PROTECTED]
> with the text 'unsubscribe gnhlug' in the message body.
> *****************************************************************
>
--
Simulated disorder postulates perfect discipline; simulated fear postulates
courage; simulated weakness postulates strength.
~ Sun Tzu
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************