Next: , Up: smapc   [Contents][Index]


7.1 Single Query Mode

The simplest way to use smapc utility is to invoke it as follows:

smapc -S url map key

The -S option introduces the URL of the server to query (see smap url). The map argument gives the name of the map to use, and the key argument supplies the search key.

For example:

$ smapc -S unix:///var/run/smap/sockmap aliases root@example.com
OK smith dmk <rev@mail.example.org>

You can give as many map-key pairs in the command line as is necessary, the only requirement being that the number of arguments be even:

$ smapc -S unix:///var/run/smap/sockmap aliases root@example.com users root
OK smith dmk <rev@mail.example.org>
OK root uid 0

If multiple map-key pairs are given in the command line, smapc can annotate each response with the corresponding query. Such annotations are enabled by the -a (--annotate) option, e.g.:

$ smapc -S unix:///var/run/smap/sockmap -a aliases root@example.com users root
aliases root@example.com: OK smith dmk <rev@mail.example.org>
users root: OK root uid 0

You may simplify the invocation if you add the URL to your initialization file, i.e. to the file smapc reads at startup for its defaults. This file resides in your home directory and is named .smapc. Open this file with your favorite editor, and add the following line to it:

open unix:///var/run/smap/sockmap

Now, when invoked without the -S option, smapc will use this URL by default:

$ smapc aliases root@example.com
OK smith dmk <rev@mail.example.org>

See Initialization File, for a detailed description of this file.


Next: , Up: smapc   [Contents][Index]