Sun Directory Services 3.1 Administration Guide

exclude Function

The exclude function removes a value from a list or a string. The syntax for this operation is:

variableA=exclude(string, exclude-value, "separator")

where:

variableA identifies the variable

string identifies the list or string

exclude-value is the value to exclude

separator marks the separation between the elements of the list or string. This value must be specified between quotes because it could be a space.

For example, to obtain the list of aliases for a machine, you need to exclude the canonical name from the list of names. You could create the following variables:

NameList=instances2string($cn, " ")
HostName=getrdn()
HostAliases=exclude(NameList, HostName, " ")

In nis.mapping, the Condense section of the hosts mapping definition contains:

ipHostAliasesLineT=exclude($allIpHostAliasesT,$ipHostNameT, " ")

This definition excludes the ipHostName from the list of alias names for the host.