User`s guide
26
Chapter 4: Controlling dbx
of these aliases, dbx simply replaces it with the command for which it is an
alias. Any arguments that you include on the command line are passed to
the command.
For example, if you to create “gf” as an alias for thegivenfile command, enter:
(dbx) alias gf givenfile
(dbx) alias gf
"givenfile"
(dbx) gf
Current givenfile is test
(dbx) gf test2
Process 22545 (test) terminated
Executable /usr/var/tmp/dbx_examples/test2
(dbx) gf
Current givenfile is test2
More complex alias definitions require more than the name of a command.
In these cases, you must enclose the entire alias definition string in double
quotation marks. For example, you can define a brief alias to print the value
of a variable that you commonly examine. Note that you must use the escape
character (\) to include the double quotation marks as part of the alias
definition. For example:
(dbx) alias pa "print \"a =\", a"
(dbx) alias pa
"print "a =", a"
(dbx) pa
a = 3
You can also define an alias so that you can pass arguments to it, much in the
same way that you can provide arguments in a C language macro definition.
When you use the alias, you must include the arguments. dbx then
substitutes the values that you provide in the alias definition.
To illustrate this, consider the following alias definition:
(dbx) alias p(arg1, arg2, arg3, arg4) "print
’|arg1|arg2|arg3|arg4|’"
(dbx) alias p
(arg1, arg2, arg3, arg4)"print ’|arg1|arg2|arg3|arg4|’"