PH(1L) UNIX 4.3 BSD (27 Aug 89) PH(1L)
NNAAMMEE
ph -- access to the CSO Nameserver (on-line phone book)
SSYYNNOOPPSSIISS
pphh [--ss server] [--pp port] query
pphh [--ss server] [--pp port] [--nn]
DDEESSCCRRIIPPTTIIOONN
_P_h queries the CSO Nameserver, a database of University
faculty, students and staff. The database contains nearly
all the information in the _S_t_u_d_e_n_t/_S_t_a_f_f _D_i_r_e_c_t_o_r_y (the
University phone book), as well as other information,
including electronic mail addresses.
_P_h may be used in two ways; interactively, or with
command-line arguments.
If given arguments, it will treat the arguments as a query,
and return the results of the query. For example,
ph steven dorner
would return the entry for the author of _p_h, Steven Dorner.
For more information on what types of queries you may make,
see the _Q_u_e_r_i_e_s section below.
If given no arguments, _p_h will enter interactive mode, print
a prompt, and wait for commands. Interactive mode will be
discussed in detail below.
_P_h is not intended for the generation of mailing lists.
Therefore, it will refuse any requests resulting in more than
a small number of matches. This is not negotiable.
OOPPTTIIOONNSS
_P_h recognizes the following options:
-n Do not read the ..nneettrrcc file. This option has
meaning only when using _p_h in interactive mode (see
below for descriptions of the .netrc file and
interactive mode.)
-s _s_e_r_v_e_r
Use _s_e_r_v_e_r as a Nameserver host, instead of the
default host.
-p _p_o_r_t
Use _p_o_r_t as the tcp port to connect to, instead of
the default port.
Page 1 (printed 10/11/89)
PH(1L) UNIX 4.3 BSD (27 Aug 89) PH(1L)
QQUUEERRIIEESS
The Nameserver's database containes over 60,000 entries.
Each entry is comprised of multiple _f_i_e_l_d_s, each containing
information about the entry. Each field has a name that is
descriptive of what the field contains; for example, the
field named _m_a_i_l__a_d_d_r_e_s_s contains the office mail address of
the person in question (for more information on fields, see
the description of the ffiieellddss command in the _I_n_t_e_r_a_c_t_i_v_e
section below).
By default, queries are assumed to refer to the _n_a_m_e field of
the entry. Therefore, saying ''pphh jjoohhnn ddooee'' looks for
entries whose name field contains ''john'' and ''doe.''
Fields other than the _n_a_m_e field must be specified; for
example,
ph dorner address=DCL
would return entries with name ''dorner'' whose address
contained ''DCL.''
Matching in _p_h is done on a word-by-word basis. That is,
both the query and the entry are broken up into words, and
the individual words are compared. Although _p_h is
insensitive to case, it otherwise requires words to match
exactly, with no characters left over; ''john'' does nnoott
match ''johnson,'' for example. This behavior may be
overriden by the use of normal shell metacharacters (''?'' to
match any single character, ''*'' to match zero or more
characters, and ''[]'' to match a single character from a set
of characters).
_P_h will display only entries that match aallll of the
specifications in the query. For example,
ph steven dorner
will return all entries with bbootthh ''steven'' and ''dorner''
in the _n_a_m_e field.
_P_h returns a certain set of fields by default. It is
possible to ask for different fields in a query. This is
done by specifying the ''_r_e_t_u_r_n'' keyword, and listing the
fields of interest. For example,
ph steven dorner return email
would print only the electronic mail address of the author of
_p_h. You may also ask for all fields in the entry, by using
``all'' as a field name. This will show you every field you
are allowed to see in the user's entry.
Page 2 (printed 10/11/89)
PH(1L) UNIX 4.3 BSD (27 Aug 89) PH(1L)
All output from _p_h is sent through _m_o_r_e (or whatever program
specified in the _P_A_G_E_R environment variable).
IINNTTEERRAACCTTIIVVEE MMOODDEE
If _p_h is given no arguments, it enters interactive mode,
where it prompts for, executes, and displays the results of
Nameserver commands. Interactive mode provides access to
more Nameserver features than mere queries. Some of these
features require the user to identify him/her self to _p_h by
use of the _l_o_g_i_n command; others do not. Commands may be
abbreviated, provided enough characters are given to
distinguish them from other commands.
TThhee ..nneettrrcc ffiillee
_P_h reads the same .netrc file as does ftp (see ftp(1)). If
it finds a _m_a_c_h_i_n_e named ``ph'' that has a login and a
password specified for it, _p_hwill automatically do a _l_o_g_i_n
command, using the values from the .netrc file. _P_h will
silently refuse to use a .netrc file that has any permissions
for group or other (see chmod(1)).
PPuubblliicc CCoommmmaannddss
The following commands do not require the user to be logged
in to the Nameserver:
hheellpp
_H_e_l_p provides explanations of Nameserver commands. Given no
arguments, _h_e_l_p lists the available help topics. Given one
of these topics as an argument, _h_e_l_p will print help for that
topic. A list of commands and a one-line description of each
command may be obtained by requesting the topic _c_o_m_m_a_n_d_s.
qquueerryy
_Q_u_e_r_y performs Nameserver queries, and works exactly like
non-interactive _p_h, except that metacharacters do not have to
be quoted.
ffiieellddss
_F_i_e_l_d_s lists the fields currently in use in the Nameserver.
For each field a display like the following (admittedly ugly)
is produced:
-200:2:email:max 64 Lookup Public Default Change Turn
-200:2:email:Preferred electronic mail address.
The leading number is a reply code form the Nameserver. The
next number is the field number. Following the field number
is the name of the field, the maximum length of the field,
and the flags for the field. The second line has, in
addition to repeated reply code, number, and name, a one-line
description of the field.
Page 3 (printed 10/11/89)
PH(1L) UNIX 4.3 BSD (27 Aug 89) PH(1L)
The flags determine how a field may be used. _L_o_o_k_u_p means
the field may be searched in a query. _I_n_d_e_x_e_d means the
field is indexed (at least one _I_n_d_e_x_e_d field must be included
in every query). _D_e_f_a_u_l_t means the field is displayed by
default. _C_h_a_n_g_e means that users may change the field. _T_u_r_n
means that display of the field may be inhibited by beginning
the field with a ''*''.
sseett option[==value]
_S_e_t allows Nameserver options to be set. These options are
for future use.
qquuiitt
Exits _p_h.
llooggiinn alias
This command identifies the user to the Nameserver. _A_l_i_a_s is
your Nameserver alias, a unique name for you in the
Nameserver; it is the first field printed in _p_h queries. You
will be prompted for your Nameserver password. This is nnoott
the same as your system password. The only way to discover
your Nameserver password is to send mail to
[email protected].
You are allowed to change your Nameserver alias; there are,
however, restrictions on Nameserver alia; they must be unique
within the Nameserver, they cannot be common names (''david''
is right out), and they can only contain letters, digits,
dashes (-) and periods (.).
CCoommmmaannddss RReeqquuiirriinngg LLooggiinn
The following commands require that the user executing them
be logged in to the Nameserver.
ppaasssswwoorrdd [alias]
This command changes your Nameserver password. You will be
asked to type your new password twice. _P_h will complain if
your password is too short, or contains only numbers
(although it does allow such passwords). Privileged users
may change the passwords of certain other users by specifying
the alias of the other user when giving the _p_a_s_s_w_o_r_d command.
mmee
This command lists the nameserver entry of the currently
logged-in user.
eeddiitt field [alias]
This command allows _p_h users to change those fields in their
entry that have the _C_h_a_n_g_e flag set. _E_d_i_t will retrieve the
value of the named field (if a value exists), and will allow
the user to edit the value with /_u_s_r/_u_c_b/_v_i (the _E_D_I_T_O_R
environment variable may be used to override the use of _v_i).
Page 4 (printed 10/11/89)
PH(1L) UNIX 4.3 BSD (27 Aug 89) PH(1L)
The changed value will then be reinserted in the Nameserver.
aadddd
Adds entries to the Nameserver. This is a privileged
command.
ddeelleettee
Deletes entries from the Nameserver. This is a privileged
command.
llooggoouutt
Undoes the effects of a _l_o_g_i_n command.
QQUUEERRYY EEXXAAMMPPLLEESS
Here are some examples to clarify _p_h queries. Each example
is preceded by the effect desired. It is assumed that the
queries are being done with _p_h from the command line, rather
than by using the interactive mode of _p_h. The only
difference for interactive mode is that metacharacters would
not have to be quoted or escaped.
Find the _p_h entry for Steven Dorner:
ph steven dorner
Find the ph entry for S. Dorner, where the rest of the first
name is not known:
ph s\* dorner
Find Alonzo Johnson (or is that JohnsEn?):
ph alonzo johns\?n
or
ph alonzo johns\[eo\]n
Find Steven D., where the rest of the last name is unknown:
ph steven d\*
The last query fails because it matches too many entries. It
is therefore necessary to narrow the search. Suppose is is
known that Steven D. has an office in DCL:
ph steven d\* address=DCL
Alternately, suppose Steven D. works for CSO. You might try:
ph steven d\* department=CSO
When that failed, a good next guess would be:
Page 5 (printed 10/11/89)
PH(1L) UNIX 4.3 BSD (27 Aug 89) PH(1L)
ph steven d\* department=computing
The moral of the story is that fields in _p_h generally contain
whatever the user wishes them to contain, and hence there may
be many different spellings and abbreviations of any
particular field (some fields are exceptions, including the
_n_a_m_e field, which is always the full name, as known to the
University, of the person involved). It pays to make liberal
use of metacharacters and creativity when searching fields
other than _n_a_m_e.
Suppose all that is wanted is full name and electronic mail
address of S. Dorner:
ph s\* dorner return name email
BBUUGGSS
Separate words in a query are allowed to match the same word
in the entry; ''ph s\* smith'' is functionally equivalent to
''ph smith,'' because the ''s*'' is allowed to match
''smith.''
There is no way to turn off the reading of the .netrc file.
DDIISSTTRRIIBBUUTTIIOONN
Source code for _p_h is available by anonymous ftp to
uxc.cso.uiuc.edu, in the net/ph subdirectory. This source
works on 4.[23]bsd Unix systems. Any troubles encountered
porting _p_h to a particular system are of interest to the
author of _p_h, as are ports done to other operating systems.
SSEEEE AALLSSOO
_T_h_e _C_S_O _N_a_m_e_s_e_r_v_e_r, _A_n _I_n_t_r_o_d_u_c_t_i_o_n, by Steven Dorner
_T_h_e _C_S_O _N_a_m_e_s_e_r_v_e_r, _S_e_r_v_e_r-_C_l_i_e_n_t _P_r_o_t_o_c_o_l, by Steven Dorner
qi(8)
AAUUTTHHOORR
Steve Dorner
University of Illinois Computing Services Office
[email protected]
Page 6 (printed 10/11/89)
Page 7 (printed 10/11/89)