DEFINE

Define strings for command line substitution.

SYNOPSIS

define [ macro_name macro_body ]

DESCRIPTION

The define command can be used for command line substitution. The name macro_name will be entered into a table with the macro_body. Any time the macro_name appears on a command line as a separate token, the macro_body is substituted. The macro_name can also appear following a '$' which will force a macro substitution. To concatenate a macro with another string, $macro_name should be used. This allows long, often-used sequences to be entered by the user once. It is similar to csh aliasing, except that it takes place anywhere on a command line.

define without any arguments will list the current definitions. To undefine a name, use the undef command. If the user desires to turn off all macros in a line, the % character can be used. A % will turn off macro expansion from the % character to the end of a line.

EXAMPLES

%define bounds xmin=0.0 xmax=5.0 ymin=0.0 ymax=20.0
This define will substitute all future occurrences of the string bounds with the list of mins and maxs.

%define q quit
This will allow the user to exit SUPREM with a q instead of typing the quit command.

echo $q $q q
If q has been defined as a macro equal to quit, all three instance will be expanded, and the output will look like:
quit quit quit

BUGS

The expansion routine does not recursively expand macros. It finds a token, and expands it once and then moves on. For example,

%define foo bar
%define froboz foo
froboz

will expand froboz to foo and no further.

SEE ALSO

The undef command.