Re: forgetting my DCL: what am I missing?




JF Mezei wrote:
> David J Dachtera wrote:
> > As to the insertion of a space, that is a bit more puzzling.
>
> Looking back at the story, there may be some consistency.
>
> The first "token" in a line is treated differently because DCL checks
> for a non explicit symbol substitution (whether a foreign command or
> just a command redefinition). The rest of the line is checked only for
> explicit symbols (eg: use of & or ' to request symbol substitution).

Please keep in mind that apostrophe substitution happens entirely in
phase 1. In this phase, the command string is simply a text string.
Ampersand substitution happens in phase 2 in which at least *some*
structure has been imposed on the "text string". My evidence to support
this statement is that the following example works:

$ DT="2-JAN 23:33"
$ DIRECTORY/SINCE=&DT/DATE/SIZE

Note that this cannot be purely a text string during ampersand
substitution because it works without the quotation marks that would
normally be needed to tell the command interpreter that a date and time
separated by a space is the single argument of the /SINCE qualifier.
This structure has been imposed on the command *before* ampersand
substitution occurs (which is consistent with the User's Manual). Yet,
it is text-string enough (well, the parameters are still text
string-ish) so that David's recent example

$ fsp := myfile.dat
$ del/lo &fsp;

also works.

> For a non explicit symbol substitution the space is probably added for
> safety to prevent the rest of the line from changing the actual command.
> (think ambiguous commands). the addition of the space ensure that the
> translated command remains by itself on the line.

Yes, I think this statement is quite relevant, especially with the fact
that DCL, in phase 2, uses the first illegal symbol-name character to
determine the end of the first token on the command line.

AEF

.



Relevant Pages

  • Re: DCL question (of the day)- null byte in string symbol
    ... The string isn't that long. ... Note that is 7 bits of the second character, 8 bits of ... Lexical substitution is a possibility. ... The fact that command verification reflects a truncated command line ...
    (comp.os.vms)
  • Re: Bug#456796: getopt and parameters with spaces
    ... There is nothing wrong with getopt. ... As you use command ... substitution without double quotes, ... This string is then read and executed by the shell. ...
    (Debian-User)
  • Re: Large binary data manipulation
    ... looked at binary data. ... It was a revelation that the string command could be used to handle ... If left unbraced, the byte-code compiler ... > substitution could break an expression. ...
    (comp.lang.tcl)
  • Re: Unsinniges Quoting verhindern
    ... Bei Command Substitution wird jedes Wort als eigenes Argument betrachtet: ... When using the $form, ...
    (de.comp.os.unix.shell)
  • Re: Beginners question
    ... The general term for this is "command substitution," and there ... Consider the following shell commands (shown as if executed on the ... hallo, world ... we use command substitution together with sed to ...
    (comp.unix.shell)