|
NAMEelmalias - expand and display Elm address aliasesSYNOPSISelmalias [ -adenrsuvV ] [ -f format ] [ name ... ]$lib/prlong [ options ... ] < file DESCRIPTIONElmalias allows you to examine information about aliases. The alias databases are consulted for each name on the command line, and the alias value is displayed, one value per line of output. If name is not a known alias, then it is displayed unchanged. If no name is given on the command line then all alias values in the databases are displayed. All of these actions are default behaviors that may be modified by command line options.There are two possible alias databases, a user-specific alias file (usually in $HOME/.elm/aliases) and a system-wide alias file (usually in $lib/aliases). By default both files are searched, first the user-specific file and then the system-wide file. If an alias file does not exist then elmalias silently ignores it and continues on. The -s and -u command line options (discussed shortly) can restrict what files are files searched. There are two types of aliases, Person aliases and Group aliases. A Person alias expands to an individual address and a Group alias contains a list of addresses, some of which may be aliases. By default, elmalias displays the defined value of an alias, regardless of type. The -e command line option (discussed shortly) fully expands out Group aliases. The default output produced is just the ``Address'' information for each name on the command line. A number of command line options (discussed shortly) may be used to select different output information or specify a format of your choosing. The following information is maintained in the alias databases, and may be accessed by the elmalias utility: • Alias (the alias name) • Last Name • Name (the user's full name) • Comment (not displayed in mail headers) • Address (the alias value) • Type (Person, Group, or Unknown) When the name specified on the command line is not a known alias, both the ``Alias'' and ``Address'' information will display as the name, the ``Type'' information will display as ``Unknown'', and all other items will be blank. The available command line options are:
The output produced by elmalias is fully customizable with the -f option. The format string uses a syntax similar to date(1) (System V version) and printf(3). The following field descriptors may be used in format specifications: %a Alias (the alias name) %l Last Name %n Name (the user's full name) %c Comment (not displayed in mail headers) %v Address (the alias value) %t Type (Person, Group, or Unknown)Field widths in a [-][m][.n] format (again, similar to printf(3)) may also be used. For example, "%-20.20a" means print the ``Alias'' information left justified in a field twenty characters long, with the value truncated to twenty characters. The following special character sequences are also recognized in format specifications: \b A backspace. \f A formfeed. \n A newline. \r A return. \t A tab. \c Literal character ``c''.There is a very simplistic conditional evaluation mechanism that may be used in format specifications. The conditional text should be surrounded by question marks, and a single character that specifies the condition immediately follows the first question mark. The condition characters correspond to the ``%'' field specifier characters, and the condition is true if the corresponding alias information is defined and nonempty. For example, if you want to display the ``Name'' information surrounded by parenthesis, but omit it if the information is not available, you may use ``?n(%n)?'' in the format specification. The command line switches that select an alternative format correspond to the following format specifiers. default "%v" -a "%-20.20a %v" -n "%v?n (%n)?" -v "%-20.20a %v?n (%n)?" -V "Alias:\t\t%a\n\ Address:\t%v\n\ Type:\t\t%t\n\ ?n Name:\t\t%n\n?\ ?l Last Name:\t%l\n?\ ?c Comment:\t%c\n?" The prlong utility formats long amounts of data, folding across multiple lines. It is useful to reformat output of elmalias. Prlong reads data from its standard input, one line at a time, and tries to place as much information as possible on each output line. A field seperator, by default a single space, seperates each input record in the output lines. Every output line is preceded by a leader field. By default the leader of the first output line is an empty string, and the leader for all subsequent output lines is a single tab. prlong will never split an input record. If an input record exceeds the maximum output line length, it will appear unmodified on an output line all by itself. The following options may be used to modify the prlong behavior.
EXAMPLESConsider an aliases.text file that contains:friends = List of Friends = tom, dick, harry tom = Tom Smith = sleepy!tom dick = Dick Jones = dopey!dick harry = = grumpy!harryBelow are shown some example commands and the output produced. $ elmalias friends tom,dick,harry $ elmalias mike mike $ elmalias -r mike elmalias: "mike" is not a known alias $ elmalias -n friends tom,dick,harry (List of Friends) $ elmalias -a friends friends tom,dick,harry $ elmalias -V friends Alias: friends Address: tom,dick,harry Type: Group Name: List of Friends Last Name: List of Friends $ elmalias -e friends tom@sleepy.acme.com dick@dopey.acme.com harry@grumpy.acme.com $ elmalias -ve friends tom tom@sleepy.acme.com (Tom Smith) dick dick@dopey.acme.com (Dick Jones) harry harry@grumpy.acme.com $ elmalias -f "alias %a is \"%v\" ?n(%n)?" -e friends alias tom is "tom@sleepy.acme.com" (Tom Smith) alias dick is "dick@dopey.acme.com" (Dick Jones) alias harry is "harry@grumpy.acme.com" $ elmalias -en friends | /usr/lib/elm/prlong -w40 tom@sleepy.acme.com (Tom Smith) dick@dopey.acme.com (Dick Jones) harry@grumpy.acme.com $ elmalias -en friends | /usr/lib/elm/prlong -1 "To: " -f ", " -w40 To: tom@sleepy.acme.com (Tom Smith), dick@dopey.acme.com (Dick Jones), harry@grumpy.acme.com The checkalias(1L) and listalias(1L) scripts distributed with the Elm package provide further examples of the elmalias and prlong utilities. AUTHORElm Development GroupSEE ALSOcheckalias(1L), elm(1L), listalias(1L), newalias(1L)BUGSThere is no centralized, comprehensive interface to the Elm 2.4 alias system, so every program in the Elm suite that uses aliases implements its own interfaces. It's possible for inconsistencies to creep in between what elmalias says and what some Elm utility does. If you find an inconsistency please report it to us!Boy, there sure are a lot of command line switches in this thing. Note that the precedence of aliases is user file then system file. This means that a user can 'overload' an alias by having one defined in the system file also defined in theirs. This shouldn't turn out to be a problem, but is something for the system administrator to keep in mind when creating the system alias file. BUG REPORTS TOBill Pemberton flash@virginia.eduCOPYRIGHTSCopyright 1993-1995 by The USENET Community Trust
Visit the GSP FreeBSD Man Page Interface. |