bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rm -- -b


From: Micah Cowan
Subject: Re: rm -- -b
Date: Sun, 30 Sep 2007 23:59:17 -0700
User-agent: Thunderbird 1.5.0.13 (X11/20070824)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bob Proulx wrote:
> A scan is made left to right across the argument list looking for
> options.  Traditional behavior and POSIX require options before
> non-option arguments.  As a GNU extension options may appear anywhere
> in the argument list.  If a "--" is encountered it is taken as the end
> of option processing.  Any arguments that follow will not be parsed as
> a option.
> 
> Because all of the programs that use getopt follow this convention it
> is good one to know for shell programming.  Almost all of the programs
> that are used in shell programming such as rm, mv, cp, grep, sed, cat,
> etc. all use getopt for option processing and all behave the same way
> with respect to option processing.  This is so fundamental that it
> almost can't be documented in each program because it would be
> replicated in almost every documentation page.  This behavior is what
> I expect to see from every program and am disappointed when it is not
> the behavior.

POSIX also has it in its Utility Conventions, and both requires this
behavior of its core utilities, and recommends their use by authors of
other utilities. Even though POSIX requires all options be specified
before non-option arguments, it is still useful for cases such as the
one in this thread's Subject. :)

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHAJrF7M8hyUobTrERCGvcAJ92Ebybppp6Sy7L9zg4bWEqIXR6rQCffE4q
/V3CWb/h9chQgy1OwH1Orr4=
=dAcl
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]