HP3000-L Archives

July 1997, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jon Diercks <[log in to unmask]>
Reply To:
Jon Diercks <[log in to unmask]>
Date:
Thu, 3 Jul 1997 17:06:07 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (65 lines)
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

ATOM RSS1 RSS2