Subject: Re: the state of regex(3)
To: NetBSD Userlevel Technical Discussion List <>
From: Bruce Korb <>
List: tech-userlevel
Date: 10/01/2004 12:29:18
"Greg A. Woods" wrote:
> > Indeed. I was heavily grossed out today when I learned what
> > POSIXLY_CORRECT does for getopt(3) (=> "ls /etc/passwd -l" *yuck*).
> You should play with a true, plain, Seventh Edition UNIX for a good long
> while before you blame POSIX on anything, especially that.
> It's all these young GNU whipper-snappers who have messed things up
> royally.

Before you start flinging too-short-in-the-tooth epithets, remember,
please, the genesis of the problem:

  sort fumble -o stumble

et al.  Such requirements made the use of the getopt() function
difficult/impossible.  So, to enable utilities that allowed misordered
options to use getopt(), getopt() was "enhanced" to make that
sort invocation look like:

  sort -o stumble fumble

to the utility.  "ls(1)" went along for the ride.  Now, we have to suffer
long-winded arguments over whether or not GNU prior art should count in the
grand scheme of portable interfaces and what happens when you have
portably named files with names that begin with a hyphen.  Yum, yum.
Well, we're here now and like it or not if you write a script (er,
"application") that might stumble into files named, "-l", then you
had best protect the name by using either "./-l" or "-- -l" on the
command line.

> (AT&T released the "real" getopt() into the public domain long before
> there was ever any kind of free unix-like OS for a very good reason --
> sadly it was, for the most part, ignored.)

It wasn't ignored.  It was "improved".  ;-)

Cheers - Bruce