Metacharacters

Autofs provides a facility to allow metacharacters to be included within the maps—in the same way that the shell allows them within its syntax. Table 18.10 shows the ones that are available, along with an example of how they may be used.

Table 18.10. Metacharacters
MetacharacterFunctionExample
&Substitute the keymsmith neon:/export/home/&
*Matches any key* neon:/export/home/&
"Escapes special charactersmsmith neon:/”some location”

For example, we can see that most lines in the auto_home map are the same, apart from the user name. Using metacharacters, we could shorten the auto_home file to the following:

testuser neon:/export/home/&
sysadmin neon:/export/home/&
msmith   neon:/export/home/&
jgreen   neon:/export/home/&

Or to match every ...

Get Solaris™ Operating Environment Boot Camp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.