Enhanced AutoFS Administrator's Guide
Configuring and Administering AutoFS
Shortcuts for AutoFS Maps
Chapter 350
Wildcard Characters
You can use asterisk (*) in an indirect map as a wildcard character to
represent the local subdirectory when you want the local subdirectory to
be the same as the remote system name or the remote subdirectory.
You can use ampersand (&) in a direct or indirect map as the remote
system name or the remote subdirectory. Whatever is in the local
directory name field replaces the ampersand character. If you have used
asterisk to represent the local subdirectory, then whatever replaces
asterisk (*) in the local subdirectory field also replaces ampersand (&) in
the remote system name or remote subdirectory field.
NOTE You cannot use the asterisk (*) wildcard in a direct map.
The following example automounts users’ home directories. The home
directories are physically located on the NFS server, basil, under the
remote directory, /export/home. On the local NFS client, the home
directories are mounted under /home.
The following example contains a line from the AutoFS master map,
/etc/auto_master, that lists the indirect map, /etc/auto_home:
# /etc/auto_master file
# local mount point map name mount options
/home /etc/auto_home -nosuid
The following example contains the line from the AutoFS indirect map,
/etc/auto_home that mounts users’ home directories on demand.
# /etc/auto_home file
# local mount point mount options remote server:directory
* basil:/export/home/&
A user’s home directory is configured in the /etc/passwd file as
/home/
username
. For example, the home directory of user terry is
/home/terry. When Terry logs on, AutoFS looks into the
/etc/auto_home map and substitutes terry for both asterisk and
ampersand. AutoFS then mounts Terry’s home directory from
/export/home/terry on the basil server to /home/terry on the local
NFS client.