[Info-vax] Local Versus Global Command Options

Lawrence D'Oliveiro ldo at nz.invalid
Sun Feb 16 19:43:35 EST 2025


On Sun, 16 Feb 2025 15:52:23 -0700, Mark Berryman wrote:

> On *nix systems, the shell parses the command line into an array of
> strings using unquoted spaces as the separator which is then passed to
> the created process.

If you don’t go through a shell, then you pass an array of already-
separated words and you don’t have to worry about shell specials.

> On VMS, the crtl does the same parsing which means the program still
> sees an array of strings the same as on a *nix system.

Consider what happens: if you pass unquoted text to program X, DCL 
converts it to uppercase, and I think also normalizes multiple spaces to a 
single space. If you don’t want the text to be uppercased or space-
normalized, you put it in pairs of double quotes. But then these double 
quotes also get passed as part of the command line. So the receiving 
program has to do some non-trivial parsing just to get simple literal text 
via the command line.

So now, how do you invoke program X directly from your own program Y, 
without going through DCL? For consistency, you have to mimic all the same 
misbehaviour of DCL to get the command line in the right format. If you 
don’t want to do that, then you need some option to tell program X to 
bypass all that special processing, and just accept the command line as 
is. So it needs to distinguish between two ways of being invoked: directly 
or via DCL!

> If I choose to use DCL, DCL does all of the parsing for me and the
> nature of the command-line is irrelevant.

If you don’t use DCL, then how do you invoke a program that expects DCL to 
parse its command line for it? What happens to all of Arne’s lovingly-
crafted .CLD files?

> Programs on DEC OSes can invoke other programs directly and
> have been able to at least since the days of the PDP-11 ...

Yes, and there have been quite a few pitfalls with that, as I mentioned 
above. Windows suffers from the same drawback, and this has even led to 
security holes with Windows programs.


More information about the Info-vax mailing list