From owner-freebsd-bugs@FreeBSD.ORG Sun Jul 20 09:40:19 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F57D37B401; Sun, 20 Jul 2003 09:40:19 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFED443FBD; Sun, 20 Jul 2003 09:40:17 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6KGeHUp058297; Sun, 20 Jul 2003 09:40:17 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6KGeH2Y058296; Sun, 20 Jul 2003 09:40:17 -0700 (PDT) Resent-Date: Sun, 20 Jul 2003 09:40:17 -0700 (PDT) Resent-Message-Id: <200307201640.h6KGeH2Y058296@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Cc: ler@lerctr.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Larry Rosenman Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EAF337B401 for ; Sun, 20 Jul 2003 09:37:41 -0700 (PDT) Received: from lerlaptop.lerctr.org (lerlaptop.lerctr.org [207.158.72.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56D8043FBD for ; Sun, 20 Jul 2003 09:37:36 -0700 (PDT) (envelope-from ler@lerlaptop.lerctr.org) Received: from lerlaptop.lerctr.org (localhost [127.0.0.1]) by lerlaptop.lerctr.org (8.12.9/8.12.9) with ESMTP id h6KGbXIc017485 for ; Sun, 20 Jul 2003 11:37:33 -0500 (CDT) (envelope-from ler@lerlaptop.lerctr.org) Received: (from ler@localhost) by lerlaptop.lerctr.org (8.12.9/8.12.9/Submit) id h6KGbXmE017484; Sun, 20 Jul 2003 11:37:33 -0500 (CDT) Message-Id: <200307201637.h6KGbXmE017484@lerlaptop.lerctr.org> Date: Sun, 20 Jul 2003 11:37:33 -0500 (CDT) From: Larry Rosenman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 X-GNATS-Notify: ler@lerctr.org Subject: misc/54661: Update last(1) to allow -n # in addition to -# for number of records X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Larry Rosenman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2003 16:40:19 -0000 >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@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: