This appendix describes the use of macros for building user templates and accounts. A description of macros for mailing from form letters is also included.
You can use macros to help initialize the form fields when you create a User Account. You can enter these macros manually. Or you can have them fill (some of) the form fields automatically by first defining them in a New User Template and using that template when you create the user account.
The following types of fields accept macros in these two windows:
For working examples, see “Macro Name”.
A macro has the following format:
<Modifiers> are optional (you can define them multiple times). You can use the <Modifiers> to specify only specific parts of the field, such as the first letter of the field, or to manipulate and convert the given input.
A modifier has the following format:
where <Converter> is one or more of the following characters:
- Convert the resulting string to lowercase
- Same as `l'
- Convert the resulting string to uppercase
- Same as `u'
- Do not include SPACEs
- Same as `s'
- Replace SPACEs with underscores (_)
and the <Range> applies to the complete string in the field (by default). Or you can apply a range to a specific word in the input string.
Consequently, a <Range> has the following format:
$<word number><Character Range>
where <word number> shows the word's sequence in the string (this is optional). The first word would be addressed as $1, the second word as $2, and so on. You can also use $0 to address the first word.
<Character Range> is a comma-separated list of character ranges in the form. If you specify a <word number>, you must first use a comma (`,') in the range list.
The character range itself has the following format:
<start char>-<end char>
where <start char> and <end char> are character numbers. You can omit one end of the range to signify the “start of string” and “end of string”, respectively. Ranges that go beyond the end of the string are truncated to match the string.
<Macro Name> is one of the following characters:
- replace with the users' GID
- replace with the user's UID
- replace with the users' group name
- replace with the user's login name (username)
- replace with data from the user's Real Name field
- replace with data from the user's Office field
- replace with data from the user's Telephone field
These definitions make more sense when they are viewed as examples. Assume for the following example, the following data is true:
You could then define the following macros and see the following substitutions.
Create the directory /home/<login name>
Get the User name and add the UID (separated by a dash)
You can also use macros to define various text strings in a form letter. You need to enter these macros manually in the appropriate form letter. The following table shows the name and the effective substitution for each of these macros.
The system date in the format of Sun Mar16
The User's Group Name will be substituted for the macro.
The User's GID will be substituted for the macro.
The User's HOME directory will be substituted for the macro.
The User's Office location will be substituted for the macro.
The User's Real Name will be substituted for the macro.
The User's Telephone number will be substituted for the macro.
The User's Login Name will be substituted for the macro.
The User's UID will be substituted for the macro.
The report displayed in the window will be included in the letter.
Only the selected lines of the report displayed in the window will be included in the letter.