System Debug Reference Manual (32650-90888)
Chapter 2 45
User Interface
Command Line Substitutions
fully defined by the W (WRITE) command in chapter 4.
The optional closing tilde (~) character is used to terminate the command line substitution
string when it appears adjacent to text that is not to participate in the substitution. The
tilde is always removed as part of the substitution.
During the preprocessing phase, a command line is scanned repeatedly until no command
line substitutions are performed. Note that, after an individual substitution is performed,
scanning continues after the point of substitution. If the substituted text causes another
substitution (by containing a new vertical bar character), it is processed during the next
scan of the command line.
The special meanings of both the vertical bar and the tilde are cancelled when they are
immediately preceded by the backslash (\) escape character. After the preprocessing phase
of command line scanning is finished, the escape characters are removed, leaving the
following vertical bar or tilde by itself. The practice of using the escape character to remove
the special meaning of some other character is known as
escaping
, and is often used in
string literals, particularly in regular expressions. Refer to appendix A for a discussion of
how patterns and regular expression can be constructed for use in pattern matching.
Command line substitutions are performed on every command line, including those which
define macros. If a macro definition is to contain a command line substitution to be
performed when the macro is executed, it should be escaped to prevent it from being
performed when the macro is defined.
Command line substitution is subject to the current state of the CMDLINESUBS environment
variable. If set to FALSE, command line substitutions are not performed.Examples of
command line substitutions are listed below:
Assuming the following declarations have been entered,
var grp = 'PUB'
var acnt = 'SYS'
var cmd = 'SYMOPEN'
var const = $20
var n = $1
the following examples demonstrate command line substitutions:
symopen myfile.|grp~.|acnt
becomes
symopen myfile.PUB.SYS
while
while n < |const:"#" do {cmd1;cmd2;cmd3}
becomes
while n < #32 do {cmd1;cmd2;cmd3}
which saves many searches for the constant. And
while |n < |const do {cmd1;cmd2;cmd3}
becomes