System Administration Guide: Resource Management and Network Services

Variables in a 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. Table 16–3 shows the predefined map variables.

Table 16–3 Predefined Map Variables

Variable 

Meaning 

Derived From 

Example 

ARCH

Architecture type 

uname -m

sun4u

CPU

Processor type 

uname -p

sparc

HOST

Host name 

uname -n

dinky

OSNAME

Operating system name 

uname -s

SunOS

OSREL

Operating system release 

uname -r

5.8

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 IA 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

Now the same entry for all clients applies to all architectures.


Note –

Most applications that are written for any of the sun4 architectures can run on all sun4 platforms, so the -ARCH variable is hard-coded to sun4 instead of sun4m.