Ultrix df snags Cnews execution
Morris Strongson
mms at bnlux1.bnl.gov
Wed Mar 20 06:36:08 AEST 1991
The last snag in getting Cnews to work on Ultrix 4.1 was related to the
difference between BSD's df and the one in Ultrix. The Ultrix version
of df puts out two header lines, e.g., for "df /var,"
Filesystem Total kbytes kbytes %
node kbytes used free used Mounted on
/dev/rz0h 494863 293868 151509 66% /usr/var
The Cnews script that determines if there is room on the disk for more
news, /usr/lib/newsbin/spacefor (also /usr/lib/news/bin/spacefor, since this
may be ahead of /usr/lib/newsbin in the path) handles the BSD form of df,
assuming the disk usage statistic is on line 2. I had to replace the line
that reads
df $arg | awk "BEGIN { nf = 4 ; nr = 2 }
with
df $arg | awk "BEGIN { nf = 4 ; nr = 3 }
because df in Ultrix has one more header line than in BSD 4.3
With nr = 2, the second heading line was being used to calculate available
disk space for news, and spacefor always concluded that there was never
enough room for new news.
This was the last snag; Cnews is now working.
Morris Strongson (mms at bnlux0.bnl.gov)
More information about the Comp.unix.ultrix
mailing list