From owner-freebsd-questions Thu May 11 23:13:42 2000 Delivered-To: freebsd-questions@freebsd.org Received: from rhenium.btinternet.com (rhenium.btinternet.com [194.73.73.93]) by hub.freebsd.org (Postfix) with ESMTP id BA42D37B721 for ; Thu, 11 May 2000 23:13:38 -0700 (PDT) (envelope-from mark@ukug.uk.freebsd.org) Received: from [213.1.107.72] (helo=parish.my.domain) by ruthenium.btinternet.com with esmtp (Exim 2.05 #1) id 12q1D8-0005q0-00 for questions@freebsd.org; Thu, 11 May 2000 23:13:38 +0100 Received: (from mark@localhost) by parish.my.domain (8.9.3/8.9.3) id XAA02200 for questions@freebsd.org; Thu, 11 May 2000 23:13:19 +0100 (BST) (envelope-from mark) Date: Thu, 11 May 2000 23:13:19 +0100 From: Mark Ovens To: questions@freebsd.org Subject: getopt(1) or getopts(1)? Message-ID: <20000511231319.C1522@parish> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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