[comp.unix.ultrix] Ultrix df snags Cnews execution

mms@bnlux1.bnl.gov (Morris Strongson) (03/20/91)

    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@bnlux0.bnl.gov)