home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

-v

Specify the value's column V8.7 and above

The manner in which the key and its value are visually displayed in flat, sequential, text files and certain network services, might not be directly suitable for use with database maps. A text-type file—for example, /etc/hosts—might display the key on the right and the value on the left:

123.45.67.89      here.our.domain

For such circumstances the -v switch can be used with the K command to specify the column or item that will be returned as the value when a key is matched. For example:

Kaddr text -k1 -v0 /etc/hosts

For nisplus, netinfo, user, and other such database maps, the -v switch specifies the name (text) of the value's column.

This -v switch specifies which column is the value to return. If it is omitted, it defaults to 0 for the text type (which is indexed beginning with 0) to the last named column for the nisplus type, and to the string "members" for the netinfo type. Note that the -v switch has a different meaning for the ph database-map type. See also -k (-k) for the value's column and -z (-z) for the column delimiter.

    Previous Section Next Section