Managing Network File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Variables in an Autofs Map Entry

You can create a client-specific variable by prefixing a dollar sign ($) to its name. The variable helps you to accommodate different architecture types that are accessing the same file system location. You can also use curly braces to delimit the name of the variable from appended letters or digits. The following table shows the predefined map variables.

Table 2-1  Predefined Map Variables
Variable
Meaning
Derived From
Example
ARCH
Architecture type
uname -m
sun4
CPU
Processor type
uname -p
sparc
HOST
Host name
uname -n
system1
OSNAME
Operating system name
uname -s
SunOS
OSREL
Operating system release
uname -r
5.10
OSVERS
Operating system version (version of the release)
uname -v
GENERIC

You can use variables anywhere in an entry line except as a key. For instance, suppose that you have a file server that exports binaries for SPARC and x86 architectures from /usr/local/bin/sparc and /usr/local/bin/x86 respectively. The clients can mount through a map entry such as the following:

/usr/local/bin	   -ro	server:/usr/local/bin/$CPU

The same entry for all clients now applies to all architectures.


Note -  Most applications that are written for any of the sun4 architectures can run on all sun4 platforms. The –ARCH variable is hard-coded to sun4.