A-Shell supports CMD and DO files, more or less just like AMOS does, with a few extensions which are noted in the following topics entitled Global DO File Parameters and Special $ Variables. For readers who may not be completely familiar with CMD and DO files, a brief overview is presented here.
CMD and DO files are basically equivalent to BAT files under DOS or shell scripts under UNIX. They are simply text files, with .CMD or .DO extensions, containing LIT commands which are executed as if they were entered at the command prompt. The only difference between CMD and DO files is that CMD files do not support argument substitution and macro expansion, whereas DO files, like their DOS and UNIX counterparts, do support these function. Note that DO files do not have to take advantage of argument substitution, thus making CMD files somewhat redundant.
In addition to the normal commands that make sense at the command prompt, CMD and DO files also support some special commands and symbols which only make sense within CMD and DO files, and which allow them to be somewhat more program-like. Consider the following sample DO file (MAIN.DO), then see the following sections for more information.
Example: MAIN.DO
$D 100 MENU ; defaults for $0 and $1
:T ; trace (echo) commands
LOG DSK0:[150,$0]
:R ; don’t trace commands
IF LOOKUP ("MENU.DAT") = -1
:<Sorry, no MENU.DAT here
>
GOTO DONE
ENDIF
RUN $1
;DONE ; (this is a label)
IF "$NU" <> "admin" ; force all users except "admin"
HOST ; to exit A-Shell
ELSE
:<
Now returning to cm prompt...
>
ENDIF