From owner-freebsd-current Wed Dec 18 13:21:17 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id NAA28303 for current-outgoing; Wed, 18 Dec 1996 13:21:17 -0800 (PST) Received: from tau-ceti.isc-br.com (root@tau-ceti.isc-br.com [129.189.2.133]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id NAA28298 for ; Wed, 18 Dec 1996 13:21:14 -0800 (PST) Received: by tau-ceti.isc-br.com (Smail3.1.28.1 #13) id m0vaTGc-0008pGC; Wed, 18 Dec 96 13:11 PST Received: from phobos.walker.org (localhost.walker.org [127.0.0.1]) by phobos.walker.org (8.8.4/8.8.4) with ESMTP id NAA00876 for ; Wed, 18 Dec 1996 13:01:14 -0800 (PST) Message-Id: <199612182101.NAA00876@phobos.walker.org> To: freebsd-current@freebsd.org Subject: Problem with /bin/sh's getopts builtin Date: Wed, 18 Dec 1996 13:01:13 -0800 From: Keith Walker Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk So, am I the only one who is having trouble with sh's getopts command not working? As of a couple of weeks ago, or at least somewhere between 2.2-SNAP-101496 and 3.0-Current, the getopts command stopped working correctly for me. As an offer of proof, I commented out the last line of the /usr/bin/lp command (*not* lpr, but lp, the POSIX compat command) so it wouldn't actually print anything, then did the following: Script started on Wed Dec 18 12:49:14 1996 phobos:/usr/bin# sh -x lp -o + ncopies= + symlink=-s + dest=lp + getopts cd:n:o: option + shift 0 phobos:/usr/bin# sh -x lp -c + ncopies= + symlink=-s + dest=lp + getopts cd:n:o: option + shift 0 phobos:/usr/bin# Script done on Wed Dec 18 12:49:58 1996 Notice the lack of any action on the part of getopts, including it not noticing that I didn't give the "-o" option an argument on the first try. Could someone try it out on their system? I don't know if I've got something misconfigured or maybe this is some strange POSIX compliancy issue. keith.