6/27 The following is the beginning of a file called from my .procmailrc.
#!/bin/csh
set usage = `quota | grep digital | awk '{print $2}'`
set quota = `quota | grep digital | awk '{print $4}'`
set spacek = `expr $quota - $usage`
\_ why do people worry about the disk quota when procmail has
a comprehensive failsafe policy? see "man procmailrc#ORGMAIL"
\_ I've had my ifile database truncated a couple times due to
quota problems.
It works just fine, but I found 1 occurance of the following in my
log file:
expr: No match.
How can expr generate a "No match error"? Presumably the quota
command yielded something like a '?' where there should have
been a number. But how would that be?
\- close, but wrong shell metachar. if you are above quota, awk
will return #####* for the usage. i note also expr may choke
on large numbers. you may also be able to use this:
If quota exits with a non-zero status,
one or more filesystems are over quota.
if you dont care about the actual numbers, you can do something
along the lines of:
quota | grep `dirname $home` | fgrep \* > /dev/null && \
echo above_q || echo below_q
btw, use less whitespace in motd posts. --psb
\_ Thanks! I just added sed 's/*//' to the set usage line. |