Sets terminal maps or code set maps.
To use setmaps with no input or output map file designation, type the following:
To select a file from the default directory as the code set map file, type the following:
To select a designated file as the code set map file, type the following:
To select a file from the default directory as the input or output terminal map file, type the following:
setmaps [ -v ] [ -D ] [ -k KeyName ] [ -d DirectoryPath ] { -i | -o } MapName
To select files from the default directory as the input or output terminal map files, type the following:
setmaps [ -v ] [ -D ] [ -d DirectoryPath ] -t MapName
To select a designated file as the input or output terminal map file, type the following:
setmaps [ -v ] [ -D ] [ -k KeyName ] { -I | -O } File1
To load the default terminal map file for later use, type the following:
setmaps [ -v ] [ -D ] [ -k KeyName ] [ -r ] -l File2
To load a designated terminal map file for later use, type the following:
Note: If this command is run without root user authority, the code set map is not loaded, only debugged.
The setmaps command handles terminal and code set maps. The -s flag must be used for code set maps. The operating system uses input and output terminal maps to convert internal data representations to the ASCII characters supported by asynchronous terminals. If you enter the setmaps command with no flags, it displays the names of the current input and output terminal maps.
A terminal map is a text file containing a list of rules that associate a pattern string with a replacement string. This file normally resides in the /usr/lib/nls/termmap directory. The operating system uses an input map file to map input from the keyboard to an application and an output map file to map output from an application to the display.
Terminal mapping works as follows:
This processing continues with the remaining characters in the buffer.
The rules of a terminal map can test and change the state of the pattern processor. The state is identified by a single-byte character, conventionally a digit (0 through 9). The state is reset to 0, the initial state, whenever the system loads a new map or flushes the terminal input or output buffer (such as when it processes a KILL or INTR character or when a program issues an ioctl system call). A terminal map can use states to detect multibyte escape sequences, among other tasks. You can test for state x by specifying @x in a pattern. You can set the state to x by including @x in the replacement string.
The setmaps command, when using the -s flag, assigns a code set map to the standard input device. The operating system uses code set maps to determine the number of bytes of memory a character requires and the number of display columns it requires.
Item | Description |
---|---|
-c | Clears all mappings on this terminal. |
-d DirectoryPath | Causes the DirectoryPath variable to be used as the path to the directory that contains the MapName variable. Specifying this flag and variable overrides the /usr/lib/nls/termmap directory. |
-D | Produces a debug program printout of the specified map on the standard output device before loading the map. When using this to run the debug program on new maps, do not run with root user authority until the map is fully debugged to prevent the map from actually being loaded. |
-h | Prints the usage information of the setmaps command (used with the -v flag for advanced users). |
-i MapName | Selects the /usr/lib/nls/termmap/MapName.in file as the input map. When used with the -s flag, this flag selects the /usr/lib/nls/csmap/MapName file as the terminal code set map file. |
-I File1 | Selects the contents of the File1 variable as the input map. The file specified by the File1 variable can be either a full path name or a path name relative to the current working directory. When used with the -s flag, this flag selects the contents of the File1 variable as the terminal code page map file. |
-k KeyName | Associates the contents of the KeyName variable with the map being selected. This key name overrides the default key, which is normally set to the value of the MapName variable. |
-l File2 | Loads the /usr/lib/nls/termmap/File2 file for later
use. The File2 variable includes the full path name and suffix
(if any) of the map file. Note: You must have root user authority to specify this flag. |
-L File1 | Loads the specified map for later use. The File1 variable
includes the full path name and suffix (if any) of the map file.
Note: You must have root user authority to specify this flag. |
-o MapName | Selects the /usr/lib/nls/termmap/MapName.out file as the terminal output map. |
-O File1 | Selects the contents of the File1 variable as the terminal output map. The File1 variable includes the full path name and suffix (if any) of the map file. |
-r | Forces reloading of the specified map, even if it is already
loaded. Terminals using the old map continue to do so until they
are logged off or until their maps are explicitly reset. If you do
not specify this flag, a map is loaded only if it has not already
been loaded into the kernel. Note: You must have root user authority to specify this flag. |
-s | Treats any map as a code set map. |
-t MapName | Selects the /usr/lib/nls/termmap/MapName.in file as the terminal input map and the /usr/lib/nls/termmap/MapName.out file as the terminal output map. |
-v | Selects verbose output. |
All maps loaded must have unique names. Use the -k flag to eliminate naming conflicts. Only the -i, -o, and -t flags implicitly add a suffix. Other flags specifying map names should include a suffix if appropriate. If a requested map name is already loaded in the kernel, that map is used even if the path information provided on the command line implies a different map.
To reset the code set map to its original state, the /usr/lib/nls/csmap/sbcs code set map should be used.
setmaps
setmaps -c
setmaps -t ibm3161-C
setmaps -k fred -i vt220
setmaps -D -L /tmp/bob > bob.dump
setmaps -s -i IBM-932
setmaps -s -i IBM-943
setmaps -s -I myEUC
Item | Description |
---|---|
/usr/bin/setmaps | Contains the setmaps command. |
/usr/lib/nls/termmap/*.in | Contains input map files. |
/usr/lib/nls/termmap/*.out | Contains output map files. |
/usr/lib/nls/csmap/sbcs | Contains code set map for a single-byte code page. |
/usr/lib/nls/csmap/IBM-943 | Contains code set map for the IBM-943 code page. |
/usr/lib/nls/csmap/IBM-eucJP | Contains code set map for the IBM-eucJP code page. |