Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2011 18:00:51 GMT
From:      Jamie Landeg Jones <jamie@bishopston.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   docs/154289: Typing error in demo script inside man page "getopt(1)"
Message-ID:  <201101251800.p0PI0pcJ006241@catflap.bishopston.net>
Resent-Message-ID: <201101251810.p0PIABZs008583@freefall.freebsd.org>

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

>Number:         154289
>Category:       docs
>Synopsis:       Typing error in demo script inside man page "getopt(1)"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 25 18:10:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jamie Landeg Jones
>Release:        FreeBSD 8.2-PRERELEASE i386
>Organization:
http://www.bishopston.com/jamie/
>Environment:
System: FreeBSD catflap.bishopston.net 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Wed Jan 19 12:51:26 GMT 2011 root@catflap.bishopston.net:/usr/obj/usr/src/sys/CATFLAP i386


	
>Description:
	

	getopt(1) man page contains the following within the sample code:

                           -a|-b)
                                   echo flag $i set; sflags="${i#-}$sflags";
                                   shift;;
                           -o)

$i and ${i are wrong - they should be $1 and ${1 respectively - as it stands, the example doesn't show which flag is being set

>How-To-Repeat:

	man getopt
>Fix:

replace $i with $1 and ${i with ${1


>Release-Note:
>Audit-Trail:
>Unformatted:



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