The substitutions file contains one line per substitution. A line consists of two fields separated by one or more tabs. The first field is the name of the substitution, the second is the value. Neither should contain the character `#', and use of text-editor metacharacters like `&' and `\' is also unwise; the name in particular is best restricted to be alphanumeric. A line starting with `#' is a comment and is ignored.
In the victims, each line on which a substitution is to be made (a target line) must be preceded by a prototype line. The prototype line should be delimited in such a way that it will be taken as a comment by whatever program processes the file later. The prototype line must contain a ``prototype'' of the target line bracketed by `=()<' and `>()='; everything else on the prototype line is ignored. Subst extracts the prototype, changes all instances of substitution names bracketed by `@<' and `>@' to their values, and then replaces the target line with the result.
If the substitutions file is
FIRST 111 SECOND 222
and the victim file is
x = 2; /* =()<y = @<FIRST>@ + @<SECOND>@;>()= */ y = 88 + 99; z = 5;
then ``subst -f substitutions victim'' changes victim to:
x = 2; /* =()<y = @<FIRST>@ + @<SECOND>@;>()= */ y = 111 + 222; z = 5;
Rich $alz added the ``-e'' flag July, 1991.