Skip site navigation (1)Skip section navigation (2)
Date:      24 Jan 2002 10:17:36 -0800
From:      "Gary W. Swearingen" <swear@blarg.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/34233: head(1) program's "usage" is wrong re -n and -c.
Message-ID:  <ofr8of8vgf.8of@localhost.localdomain>

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

>Number:         34233
>Category:       bin
>Synopsis:       head(1) program's "usage" is wrong re -n and -c.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 24 10:20:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Gary W. Swearingen
>Release:        FreeBSD 4.5-PRERELEASE i386
>Organization:
none
>Environment:
n/a
================
>Description:

The head(1) program usage string is
    "usage: head [-n lines] [-c bytes] [file ...]\n"
but should be
    "usage: head [-n lines | -c bytes] [file ...]\n".
================
>How-To-Repeat:

$ head -n 3 -c 3
head: can't combine line and byte counts

$ head -h
head: illegal option -- h
usage: head [-n lines] [-c bytes] [file ...]
================
>Fix:

(Untested.)

patch -d "/usr/src/usr.bin/head" < this-PR

--- /tmp/head..orig.c	Thu Jan 24 09:40:50 2002
+++ /tmp/head.c	Thu Jan 24 09:41:06 2002
@@ -187,6 +187,6 @@
 void
 usage()
 {
-	(void)fprintf(stderr, "usage: head [-n lines] [-c bytes] [file ...]\n");
+	(void)fprintf(stderr, "usage: head [-n lines | -c bytes] [file ...]\n");
 	exit(1);
 }
>Release-Note:
>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?ofr8of8vgf.8of>