Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 1998 16:13:38 +0100 (CET)
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/8730: repquota output needs new formatting (diffs included)
Message-ID:  <199811171513.QAA14761@internal>

next in thread | raw e-mail | index | archive | help

>Number:         8730
>Category:       bin
>Synopsis:       repquota output needs new formatting (diffs included)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 17 07:20:01 PST 1998
>Last-Modified:
>Originator:     Andre Albsmeier
>Organization:
>Release:        FreeBSD 2.2.7-STABLE i386
>Environment:

FreeBSD 2.2.7-STABLE with quotas enabled

>Description:

The output of repquota is screwed up if a user may have more that
99999 files:

root@server:~>repquota -a
                        Block limits               File limits
User            used    soft    hard  grace    used  soft  hard  grace
riek      --  258559  400000 1200000          13928 40000120000
...

Here the hard limits are 120000 files. This output is difficult to
get parsed by shell scripts, for example.

Since big hard disks get cheaper every day, I would suggest changing
the output format a little for both, block and file data.

>How-To-Repeat:

Set the quotas as shown above.

>Fix:

--- usr.sbin/repquota/repquota.c.ORI	Tue Nov 17 15:53:51 1998
+++ usr.sbin/repquota/repquota.c	Tue Nov 17 15:59:29 1998
@@ -216,8 +216,8 @@
 		fup->fu_dqblk = dqbuf;
 	}
 	fclose(qf);
-	printf("                        Block limits               File limits\n");
-	printf("User            used    soft    hard  grace    used  soft  hard  grace\n");
+	printf("                          Block limits                    File limits\n");
+	printf("User             used     soft     hard  grace     used   soft   hard  grace\n");
 	for (id = 0; id <= highid[type]; id++) {
 		fup = lookup(id, type);
 		if (fup == 0)
@@ -226,7 +226,7 @@
 		    fup->fu_dqblk.dqb_curblocks == 0)
 			continue;
 		printf("%-10s", fup->fu_name);
-		printf("%c%c%8lu%8lu%8lu%7s",
+		printf("%c%c%9lu%9lu%9lu%7s",
 			fup->fu_dqblk.dqb_bsoftlimit &&
 			    fup->fu_dqblk.dqb_curblocks >=
 			    fup->fu_dqblk.dqb_bsoftlimit ? '+' : '-',
@@ -240,7 +240,7 @@
 			    fup->fu_dqblk.dqb_curblocks >=
 			    fup->fu_dqblk.dqb_bsoftlimit ?
 			    timeprt(fup->fu_dqblk.dqb_btime) : "");
-		printf("  %6lu%6lu%6lu%7s\n",
+		printf("  %7lu%7lu%7lu%7s\n",
 			fup->fu_dqblk.dqb_curinodes,
 			fup->fu_dqblk.dqb_isoftlimit,
 			fup->fu_dqblk.dqb_ihardlimit,
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811171513.QAA14761>