🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: de.comp.os.unix
2 messages
2 total messages Started by $ Burkhard Kohl Tue, 02 Nov 1993 21:05
getopt fuer standard tools vorgeschrieben?
#1100
Author: $ Burkhard Kohl
Date: Tue, 02 Nov 1993 21:05
23 lines
1663 bytes
Neulich ist (unter SunOs.4.1.2) mal wieder das alte aber immer wieder gern
diskutierte Problem aufgetreten, eine Datei `-' zu loeschen.

Da ich nun selber mal eine Weile UNIX-Kurse gegeben habe, war mein erster 
Versuch:
	rm -- -
was aber ungnaedig mit einer Meldung 
	usage: rm [-rif] file ...
beschieden wurde. Dito unter Solaris 5.2. Linux macht es dagegen.

Das heisst doch wohl das SunOs-rm nicht getopt(3) benutzt. Was mich nun inter-
essiert ist, ob der XPG bzw. POSIX dazu etwas sagen. 

P.S.: Ich hab die Datei natuerlich geloescht bekommen, also bitte keine Loesungs-
hinweise.

---
  _/_/_/_/_/  _/_/_/_/  _/_/_/_/     Burkhard Kohl 
     _/      _/    _/       _/       buk@taz.de
    _/      _/_/_/_/      _/         die tageszeitung
   _/      _/    _/     _/           Germany
  _/      _/    _/    _/             10969 Berlin        Phone: +30-259-02-120
 _/      _/    _/   _/_/_/_/         Kochstr. 18         FAX  : +30-251-06-94
Re: getopt fuer standard tools vorgeschrieben?
#1101
Author: Thomas Koenig
Date: Tue, 02 Nov 1993 23:51
33 lines
1979 bytes
buk@taz.de ($ Burkhard Kohl) writes:

>	rm -- -
>was aber ungnaedig mit einer Meldung 
>	usage: rm [-rif] file ...
>beschieden wurde. Dito unter Solaris 5.2. Linux macht es dagegen.

In POSIX.2 D11-2, den ich vorliegen hab, steht:

 2.10.2  Utility Syntax Guidelines

 The following guidelines are established for the naming of utilities and
 for the specification of options, option-arguments, and operands.

[...]

    Guideline 10:    The argument "--" should be accepted as a delimiter
                     indicating the end of options.  Any following
                     arguments should be treated as operands, even if they
                     begin with the '-' character.  The "--" argument
                     should not be used as an option or as an operand.


Und, weiter unten:

 4.53.3  Options

 The rm utility shall conform to the utility argument syntax guidelines
 described in 2.10.2.
-- 
Thomas Koenig, ig25@rz.uni-karlsruhe.de, ig25@dkauni2.bitnet
The joy of engineering is to find a straight line on a double
logarithmic diagram.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads