misc/54661: Update last(1) to allow -n # in addition to -# for
number of records
Larry Rosenman
ler at lerctr.org
Sun Jul 20 09:40:19 PDT 2003
>Number: 54661
>Category: misc
>Synopsis: Update last(1) to allow -n # in addition to -# for number of records
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Jul 20 09:40:17 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Larry Rosenman
>Release: FreeBSD 5.1-CURRENT i386
>Organization:
LERCTR Consulting
>Environment:
System: FreeBSD lerlaptop.lerctr.org 5.1-CURRENT FreeBSD 5.1-CURRENT #29: Fri Jul 18 13:29:29 CDT 2003 ler at lerlaptop.iadfw.net:/usr/obj/usr/src/sys/LERLAPTOP i386
>Description:
My UnixWare (System V Release 5) system allows -n # to be used for
the last command, and I find it annoying that the FreeBSD version
doesn't accept this.
The Patch below will allow both.
Unfortunately, I'm not a mdoc person, so I did NOT do a man page
patch, as I'm not familiar enough with it. If a doc person could
point me to the appropriate doc, or make the change, I'd appreciate it.
The patch is to /usr/src/usr.bin/last:
>How-To-Repeat:
type last -n 20, notice error.
>Fix:
--- last.c.orig Wed Oct 30 12:19:59 2002
+++ last.c Sun Jul 20 11:16:00 2003
@@ -113,7 +113,7 @@
usage(void)
{
(void)fprintf(stderr,
-"usage: last [-#] [-y] [-d [[CC]YY][MMDD]hhmm[.SS]] [-f file] [-h host]\n"
+"usage: last [-#] [-n #] [-y] [-d [[CC]YY][MMDD]hhmm[.SS]] [-f file] [-h host]\n"
"\t[-t tty] [-s|w] [user ...]\n");
exit(1);
}
@@ -129,7 +129,7 @@
maxrec = -1;
snaptime = 0;
- while ((ch = getopt(argc, argv, "0123456789d:f:h:st:wy")) != -1)
+ while ((ch = getopt(argc, argv, "0123456789d:f:h:n:st:wy")) != -1)
switch (ch) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
@@ -148,6 +148,9 @@
break;
case 'd':
snaptime = dateconv(optarg);
+ break;
+ case 'n':
+ maxrec = atol(optarg);
break;
case 'f':
file = optarg;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list