elmalias - expand and display Elm address aliases
$lib/prlong [ options ... ] < file
* 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:
%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.
friends = List of Friends = tom, dick, harry
tom = Tom Smith = sleepy!tom
dick = Dick Jones = dopey!dick
harry = = grumpy!harry
Below 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.
|
Закладки на сайте Проследить за страницей |
Created 1996-2025 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |