Subject: | |
From: | |
Reply To: | |
Date: | Fri, 4 Jul 1997 09:09:55 +0200 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
THANKS, this was really great! I had no idea 'awk' could do this, on my
system! I'd better look into that. Anyone has any pointers to info that
would help me start using awk, on the 3k?
Jon wrote:
> This isn't particularly relevant to the other discfree thread going on
now,
> but it's almost time for a three-day weekend so I deserve a frivolous
> diversion. How would you like a :discfree format 'Z' like this? :
>
> :df z
> dev size utilization
> 1 0.6G ********************************................... 64%
> 2 0.6G ****************************************........... 76%
> 21 1.9G ***************************************............ 75%
> 22 1.9G ***************************************............ 76%
> 23 1.9G ***************************************............ 75%
> 24 2.0G ***************************************............ 75%
> 25 2.0G ***************************************............ 76%
> 26 2.0G ***************************************............ 76%
>
> all 12.8G ***************************************............ 75%
>
>
> Nifty, eh? Here's how to do it:
>
> :print df.cmds.sys
> parm format=e
> if ups('!format')='Z'
> discfree c >df1
> /bin/awk "-f /SYS/CMDS/DFA" <df1
> purge df1,temp
> else
> discfree !format
> endif
>
> :print dfa.cmds.sys
> BEGIN {print "dev size utilization"}
>
> # ldev 12 is a cd-rom on our system, not relevant for discfree
> /^LDEV/ {d=$3; if(d!=12)printf("%3s ",$3)}
>
> /^ Device/ && d!=12 && !t {
> printf("%5.1fG ",$3/4/1024/1024);
> for(i=0;i<$5/$3*60;i++) printf("*");
> for(i=0;i<($3-$5)/$3*60;i++) printf(".");
> printf(" %3d%%\n",$5/$3*100);
> tc+=$3;
> tu+=$5;
> }
>
> /^TOTALS/ {
> t=1;
> printf("\nall %5.1fG ",tc/4/1024/1024);
> for(i=0;i<tu/tc*60;i++) printf("*");
> for(i=0;i<(tc-tu)/tc*60;i++) printf(".");
> printf(" %3d%%\n\n",tu/tc*100);
> }
>
>
> Enjoy!
>
> Jon "awk is my friend" Diercks
>
>
> ________________________________________________________
> Jon Diercks * Systems Manager Computing Services
> [log in to unmask] (PGP available) Anderson University
> http://rowlf.csv.anderson.edu/ 1100 East Fifth St
> (317)641-4305 * FAX (317)641-3851 Anderson, IN 46012
>
|
|
|