Path: utzoo!utstat!helios.physics.utoronto.ca!news-server.csri.toronto.edu!rutgers!uwvax!umn-d-ub!cs.umn.edu!bungia!cimcor!atc!hawkmoon!det From: det@hawkmoon.MN.ORG (Derek E. Terveer) Newsgroups: news.software.b Subject: Re: spacefor under sysV3.2 Message-ID: <1990May23.205735.3150@hawkmoon.MN.ORG> Date: 23 May 90 20:57:35 GMT Organization: Home System (One of the Eternal Champions) Lines: 38 Someone asked: > Sean> Does anyone have a spacefor that works on sysV3.2? When you run build, it asks for the type of system to use when constructing a spacefor program. I stated that is was either usg or sysv (i can't remember which right now -- but it was fairly obvious). The spacefor program that was then created simply did not work under esix 5.3.2-c (which is a sysV3.2 system). However, the only change required by me to get it to work was to change the "nr = 2" to "nr = 1" in the awk script. See below. # In the following, the initialization of nf determines which field the # block count comes from, and the one for nr determines which line. For # System V, the Makefile edits in a sed which tries to strip silliness # off in a reasonably System-V-variant-independent way. Expr would be # faster than awk, but on a 16-bit machine, expr does 16-bit arithmetic, # which isn't enough. # this is set up for the stupid System V df df $arg | sed "s/.*:/: :/" | awk "BEGIN { nf = 3 ; nr = 1 } ^^^^^^^^ change from nr=2 to nr=1 NR == nr && NF >= nf { nb = (\$nf - $desire) * $dfunit / $1 if (nb > 10000) nb = 10000 # ensure representable as integer nb = int(nb) if (nb <= 0) print 0 else print nb exit } NR == nr && NF < nf { # idiotic Berkeley continuation nr += 1 nf -= 1 }" -- Derek Terveer det@hawkmoon.MN.ORG