The general syntax of an A-Shell system command line is:
<command-name> {switches} {arguments} {switches}
or, in the case of many commands that operate on files, and/or which accept wildcard filespecs:
<command-name> {<outfile>=} {wildcard list} {switches}
<Angular brackets> are used in these syntax examples to indicate a token that must be replaced, while {curly brackets} indicate items that may be replaced (i.e., are optional). So in the example above, {<outfile>=} indicates an optional term; if specified, <outfile> must be replaced with an actual argument, such as myfile.txt.
The command name (e.g. COPY) is never case sensitive, and is generally given as just the name, without the extension or the directory location. Specifying more than just the name may alter the search path (for which see next topic). If the command takes arguments, they are usually not case sensitive, but this could be up to the discretion of the command implementation.
Switches are always preceded by a forward slash, and are virtually never case sensitive. In most cases, the switch may be abbreviated to the minimum number of unique characters for that command. For example, many commands support the switch /query, which can usually be abbreviated to /q. In some cases switches may precede the arguments, but the most common position is at the end.
The <outfile=> syntax element in the second example above indicates that the output of the command will be sent to that file, rather than to the screen. This is roughly the AMOS equivalent of the UNIX technique of redirecting stdout to a file.
For some commands, like COPY and APPEND, <outfile=> is mandatory.
Also note that unlike DOS and UNIX, output file arguments precede the input file arguments—i.e., they are reversed—and are separated by the equal sign.
Command lines are tokenized using both spaces and commas, plus other punctuation characters. For example, the command name itself may be terminated by a space, slash, equal sign, or new line. Arguments for LIT commands are typically separated by commas, while arguments for DO commands must be separated by spaces.
The semicolon marks the beginning of a comment, as in this example:
DIR/V MYAPP.LST=A.RUN,B.RUN,C.RUN ;this is a comment
This would create the file myapp.lst containing the directory information including version (/V) of the three specified files.