Date: Thu, 11 May 2000 23:13:19 +0100 From: Mark Ovens <mark@ukug.uk.freebsd.org> To: questions@freebsd.org Subject: getopt(1) or getopts(1)? Message-ID: <20000511231319.C1522@parish>
next in thread | raw e-mail | index | archive | help
Can someone clarify getopt(1) and getopts(1)? According to sh(1):
getopts optstring var
The POSIX getopts command. The getopts command deprecates the
older getopt(1) command.....
but there is no manpage for getopts(1), only getopt(1). The latter
includes some sample code which works fine, however if I change
``getopt'' to ``getopts'' in this code I get:
parish:/usr/marko{89}% ./foobar -b
getopts: -b: bad variable name
Usage: ...
parish:/usr/marko{90}%
Since getopt(1) is deprecated it would be better to use getopts(1).
Can anyone explain the above error, or point me to some documentation
for getopts(1)?
Thanks.
--
...and on the eighth day God created UNIX
________________________________________________________________
FreeBSD - The Power To Serve http://www.freebsd.org
My Webpage http://ukug.uk.freebsd.org/~mark/
mailto:mark@ukug.uk.freebsd.org http://www.radan.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000511231319.C1522>
