Re: Local Versus Global Command Options

Liste des GroupesRevenir à co vms 
Sujet : Re: Local Versus Global Command Options
De : jayjwa (at) *nospam* atr2.ath.cx.invalid (jayjwa)
Groupes : comp.os.vms
Date : 18. Feb 2025, 00:46:49
Autres entêtes
Organisation : Atr2 RG 2025
Message-ID : <878qq4m8wm.fsf@atr2.ath.cx>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Gnus/5.13 (Gnus v5.13)
Lawrence D'Oliveiro <ldo@nz.invalid> writes:

Can you show us a simple C program that just prints out its command
arguments, and how it responds to some sample command lines?
VMS seems to be alone in converting case.

✔≻ cat cmdlin.c
/* A program to demo printing of command line args under various OSs. */
#include <stdio.h>


int main( int argc, char *argv[] ) {
        printf( "Did I hear you say %s?\n", argv[1] );
        return 0;
}
✔≻ gcc -o cmdlin cmdlin.c
✔≻ ./cmdlin Hello World
Did I hear you say Hello?
✔≻ ./cmdlin "Hello World"
Did I hear you say Hello World?

@compile cmdlin.c                                                                                                  
KCC:    CMDLIN                                                                                                     
 "CMDLIN.C", line 9: [Note] Parameter "argc" not used                                                       
       (main+4, p.1 l.8):  "Did I hear you say %s?\n", argv[1] );  return 0; }                             
                                                                                                                   
<JAYJWA.PROGRAMMING>CMDLIN.PRE.1                                                                     
<JAYJWA.PROGRAMMING>CMDLIN.FAI.1                                                                      
FAIL:  CMDLIN
@load cmdlin
LINK:   Loading
@save cmdlin
 CMDLIN.EXE.2 Saved
@cmdlin Hello World
Did I hear you say Hello?
@cmdlin "Hello World"
Did I hear you say Hello World?

c:\bcc32 -5 -ecmdlin.exe cmdlin.c
c:\cmdlin Hello World
Did I hear you say Hello?
c:\cmdlin "Hello World"
Did I hear you say Hello World?

$ cc /version
Compaq C V6.4-005 on OpenVMS VAX V7.3
$ cc cmdlin.c
$ link cmdlin
$ mcr DUA1:[JAYJWA.PROGRAMMING.C]cmdlin Hello World
Did I hear you say hello?
$ mcr DUA1:[JAYJWA.PROGRAMMING.C]cmdlin "Hello World"
Did I hear you say Hello World?

This matters with tools like curl (-O vs -o) and zip (-V and -v).

--
PGP Key ID: 781C A3E2 C6ED 70A6 B356  7AF5 B510 542E D460 5CAE
       "The Internet should always be the Wild West!"

Date Sujet#  Auteur
13 Feb 25 * Local Versus Global Command Options53Lawrence D'Oliveiro
14 Feb 25 +* Re: Local Versus Global Command Options2Arne Vajhøj
14 Feb 25 i`- Re: Local Versus Global Command Options1Arne Vajhøj
14 Feb 25 +* Re: Local Versus Global Command Options49Simon Clubley
14 Feb 25 i+* Re: Local Versus Global Command Options44Arne Vajhøj
14 Feb 25 ii`* Re: Local Versus Global Command Options43Simon Clubley
15 Feb 25 ii `* Re: Local Versus Global Command Options42Arne Vajhøj
15 Feb 25 ii  `* Re: Local Versus Global Command Options41Arne Vajhøj
15 Feb 25 ii   +* Re: Local Versus Global Command Options2Arne Vajhøj
18 Feb 25 ii   i`- Re: Local Versus Global Command Options1Arne Vajhøj
15 Feb 25 ii   `* Re: Local Versus Global Command Options38Lawrence D'Oliveiro
16 Feb 25 ii    +- Re: Local Versus Global Command Options1Arne Vajhøj
16 Feb 25 ii    `* Re: Local Versus Global Command Options36Mark Berryman
17 Feb 25 ii     `* Re: Local Versus Global Command Options35Lawrence D'Oliveiro
17 Feb 25 ii      `* Re: Local Versus Global Command Options34Mark Berryman
17 Feb 25 ii       +* Re: Local Versus Global Command Options2bill
17 Feb 25 ii       i`- Re: Local Versus Global Command Options1Robert A. Brooks
17 Feb 25 ii       `* Re: Local Versus Global Command Options31Lawrence D'Oliveiro
18 Feb 25 ii        +* Re: Local Versus Global Command Options4jayjwa
18 Feb 25 ii        i+- Re: Local Versus Global Command Options1Arne Vajhøj
18 Feb 25 ii        i+- Re: Local Versus Global Command Options1Lawrence D'Oliveiro
18 Feb 25 ii        i`- Re: Local Versus Global Command Options1Lawrence D'Oliveiro
18 Feb 25 ii        +* Re: Local Versus Global Command Options2Arne Vajhøj
18 Feb 25 ii        i`- Re: Local Versus Global Command Options1Lawrence D'Oliveiro
18 Feb 25 ii        `* Re: Local Versus Global Command Options24Mark Berryman
19 Feb 25 ii         `* Re: Local Versus Global Command Options23Lawrence D'Oliveiro
19 Feb 25 ii          `* Re: Local Versus Global Command Options22Arne Vajhøj
19 Feb 25 ii           +* Re: Local Versus Global Command Options20Dan Cross
19 Feb 25 ii           i`* Re: Local Versus Global Command Options19Robert A. Brooks
19 Feb 25 ii           i `* Re: Local Versus Global Command Options18Arne Vajhøj
19 Feb 25 ii           i  +* Re: Local Versus Global Command Options16Dan Cross
21 Feb 25 ii           i  i`* Re: Local Versus Global Command Options15Stephen Hoffman
21 Feb 25 ii           i  i `* Re: Local Versus Global Command Options14Lawrence D'Oliveiro
22 Feb 25 ii           i  i  +* Re: Local Versus Global Command Options10Arne Vajhøj
22 Feb 25 ii           i  i  i`* Re: Local Versus Global Command Options9Lawrence D'Oliveiro
22 Feb 25 ii           i  i  i `* Re: Local Versus Global Command Options8Arne Vajhøj
22 Feb 25 ii           i  i  i  +* Re: Local Versus Global Command Options6Dave Froble
22 Feb 25 ii           i  i  i  i`* Re: Local Versus Global Command Options5Arne Vajhøj
22 Feb 25 ii           i  i  i  i `* Re: Local Versus Global Command Options4Arne Vajhøj
22 Feb 25 ii           i  i  i  i  +* Re: Local Versus Global Command Options2Dave Froble
22 Feb 25 ii           i  i  i  i  i`- Re: Local Versus Global Command Options1Arne Vajhøj
22 Feb 25 ii           i  i  i  i  `- Re: Local Versus Global Command Options1Lawrence D'Oliveiro
22 Feb 25 ii           i  i  i  `- Re: Local Versus Global Command Options1Lawrence D'Oliveiro
22 Feb 25 ii           i  i  `* Re: Local Versus Global Command Options3Dave Froble
22 Feb 25 ii           i  i   `* Re: Local Versus Global Command Options2Dan Cross
22 Feb 25 ii           i  i    `- Re: Local Versus Global Command Options1Chris Townley
20 Feb 25 ii           i  `- Re: Local Versus Global Command Options1Lawrence D'Oliveiro
20 Feb 25 ii           `- Re: Local Versus Global Command Options1Lawrence D'Oliveiro
22 Feb 25 i`* Re: Local Versus Global Command Options4Brian Schenkenberger
22 Feb 25 i +* Re: Local Versus Global Command Options2Lawrence D'Oliveiro
22 Feb 25 i i`- Re: Local Versus Global Command Options1Dave Froble
24 Feb 25 i `- Re: Local Versus Global Command Options1Simon Clubley
5 Mar 25 `- Re: Local Versus Global Command Options1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal