CL -- Using the Shell Command Line parser 88/01/29
Beginning with Software Release 4, many Shell commands have been changed to
use a common command line parsing procedure. The procedure determines how
each command processes the command line information. Commands which implement
this common command line handling are noted as such in their HELP files by a
{cl} on the usage line. The common options listed below are NOT enumerated
for each command.
COMMON OPTIONS
1. All commands that use the Command Line parser recognize the
following common command options:
- -qa Query all -- cause the command to query for each name
before operating on the name.
- -qw Query wild -- cause the command to query for all names
which have been specified using wildcards before operating on
those names. This is only available for commands which accept
wildcards.
- -nq No Query -- suppress any query for names.
- -ae Abort on Error -- cause the command to abort immediately
if it has trouble. These commands normally go on to the next
name.
When a query option is selected, the command writes each pathname
to error output (attached to the process transcript pad by
default), followed by a question mark. The command then reads a
response from error input (attached to the keyboard by default).
This response may be:
y to operate on the name
n to ignore the name
q to quit immediately
g to suppress further queries for names
d to set the default. The default action is used when a
null line is entered in response to a query. Follow
the "d" with "yes," "no," or "none."
The initial default is "none."
2. Commands which are destructive, such as dlf (delete_file), dlt
(delete_tree), and cpf (copy_file) (when the -replace keyword is
used) will query for all names which have been specified using
wildcards. This query can be suppressed by using -nq, or extended
to all names by using -qa.
COMMON FEATURES
In addition to the common command options listed above, each command that uses
the Command Line parser provides the following features:
1. You may use wildcards to specify existing pathnames. For example,
$ prf ?*.lst
and
$ dlf /fred/.../?*.bak /jon/?*.bak
For information about wildcards, type help wildcards.
2. When a command requires pairs of names which are in some way
related, 'derived names' may be used. (Such commands include chn
(change_name) and cpf (copy_file).) help wildcards also describes
derived names. For example,
$ cpf ?*.pas /source/=
and
$ chn {%.pas}.03.?? @1.backup
3. You may also use a derived name repeatedly with multiple source
names. This is specified by enclosing source names in parentheses.
For example,
$ chn (a b c) =.old
renames "a" to "a.old", "b" to "b.old", etc.
4. When meaningful, multiple names are accepted from the command line.
Thus, such commands as crl (create_link), prf (print_file), and crd
(create_directory) can operate on several files at once. For
example,
$ crd dir1 dir2 dir3
and
$ crl /latest //them/latest /streams //sloth/streams
and
$ prf prog.ins.pas prog.lst oldprog.lst
5. When a "*" appears on the command line, standard input is read for
further names and arguments. For example,
$ dlf * -qa
file_a
file_b
?*.bak
*** EOF ***
$
If multiple names appear per line, the second and subsequent names
are considered to be derived names. Thus, the following commands
are equivalent:
(a) $ chn a a.old b b.old (b) $ chn * (c) $ chn * =.old
a a.old a
b b.old b
*** EOF *** *** EOF ***
6. The "*" operator may also be used to cause names to be read from a
file, in lieu of standard input. To do this, follow the "*" with
the name of the file, with no intervening space. For example,
$ dlf *//gerry/delete_these
and
$ cpf *run_file_list /latest/com/=