ypmatch(1) ypmatch(1)
NAME
ypmatch - output selected information from an Network Information Ser-
vice file
SYNOPSIS
ypmatch [-d domain] [-k] key [key...] mapname Format 1
ypmatch -x Format 2
DESCRIPTION
You can use this command to output information from a NIS file. Unlike
ypcat, it does not output the entire file but only specific informa-
tion. You determine which information is output by specifying a key.
This command is useful if you are looking for a certain entry in a NIS
file and do not want to check the whole file.
The command can only be executed if the ypserv daemon is active on at
least one NIS server, and the ypbind daemon is active on the local
host.
The ypmatch command asks the ypbind daemon on the local host for the
Internet address and the port number of the appropriate ypserv daemon.
The ypmatch command subsequently fetches the data from this ypserv
daemon.
OPTIONS
-d domain
must be specified if the NIS file to be examined does not belong
to the current domain. domain is the name of the other domain.
If this argument is omitted, the name used is the name output
when the domainname(1) command is issued.
-k outputs the key itself, followed by a colon, before the the
information.
This argument is useful if
- the keys themselves are not part of the information
- you have specified so many keys that the output could be
confusing.
Page 1 Reliant UNIX 5.44 Printed 11/98
ypmatch(1) ypmatch(1)
key is the key for which the corresponding information is to be
searched for in the NIS file and output.
The key must be entered exactly as it appears in the NIS file
(i.e. with regard to capitalization and length). If the key as it
is entered does not match a key in the NIS file, an error message
is issued informing you that no record with this key could be
found. More than one key can be specified.
mapname
Name of the NIS file for which values matching the specified key
are to be displayed.
-x A table for converting aliases to long names is output in the NIS
files.
You will find an overview of the standard NIS files under the descrip-
tion of the ypcat(1) command.
EXAMPLES
You would like to check the entry for the user name barbara in the NIS
file passwd.byname.
Input:
ypmatch barbara passwd.byname
Output:
barbara:x:3337:4446:,,,,universe(att):/usr/barbara:/bin/sh
By specifying the key barbara, you obtain the information associated
with this key.
You would like to check the TCP port number of the SMTP service in the
NIS file services.byname.
Input:
ypmatch smtp/tcp services.byname
Output:
smtp 25/tcp mail
The key in this example is smtp/tcp and not as one might suppose smtp.
SEE ALSO
ypcat(1), ypserv(1M).
Page 2 Reliant UNIX 5.44 Printed 11/98