SETMAPS(1,C) AIX Commands Reference SETMAPS(1,C) ------------------------------------------------------------------------------- setmaps PURPOSE Sets terminal maps. +--------------------------------------------+ | | setmaps ----| one of |--| | +------+ +------------+ +--------------+ | +-| |--| -i mapname |--| |-+ +- -r -+ | -I mapname | +- -k keyname -+ | -o mapname | | -O mapname | | -t mapname | +------------+ one of +----+ setmaps ----| -h |--| | -c | +----+ Notes: 1. This command does not have MBCS support. 2. You must be a superuser or a member of the system group to load a a map. (Any user can activate a loaded map with IMAP.) DESCRIPTION The setmaps command assigns a terminal map to the standard input device. A terminal map translates character codes between AIX code page P0 (based on code page 850) and a code page appropriate for your terminal; AIX uses input and output terminal maps to convert multibyte or NLS characters in the data stream to the ASCII characters supported by asynchronous terminals. If you call setmaps with no arguments, 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 directory /etc/nls/termmap. AIX 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. For example, suppose you are using a VT220 emulator such as the AADU em2 Processed August 22, 1991 SETMAPS(1,C) 1 SETMAPS(1,C) AIX Commands Reference SETMAPS(1,C) command to login to AIX and need to use a NLS character such as the letter u with an umlaut. On AIX code page P0, u-umlaut is represented as hexadecimal 81. On the VT220 code page, u-umlaut is represented as hexadecimal FC. Using the setmaps command, you can set your terminal input and output map to VT220, which causes the u-umlaut character to appear correctly on your screen. Terminal mapping works as follows. The system collects characters in a buffer until a pattern specified by a rule in the map file matches a substring in the buffer. The system then constructs and returns the replacement string specified by the rule. 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-9). The state is reset to zero, the initial state, whenever the system loads a new map or flushes the terminal input or output buffer (as when it processes a kill or intr character or a program issues an ioctl system call). A terminal map can use states to do such things as detect multibyte escape sequences. You can test for state x by specifying @x in a pattern; you can set the state to x by including @x in a replacement string. The special name NOMAP will clear the corresponding mapping. FILE FORMAT The text of a terminal map file is a set of rules. Each rule has the following format: pattern:replacement The pattern string can include the following special characters: ? Matches any single byte @x Matches this rule only if the pattern processor is in state x, where x is any single byte. (This sequence does not match a character in the input buffer.) \? \@ \\ Prevents the pattern processor from interpreting ?, @, or \ as special characters. \ddd Represents any byte in octal notation. \xdd Represents any byte in hexadecimal notation. The replacement string can also include the following special characters: $n Uses the nth character in the input string that matched this pattern, where n is a decimal digit. @x Moves the pattern processor into state x. (This sequence does not become part of the replacement string.) Processed August 22, 1991 SETMAPS(1,C) 2 SETMAPS(1,C) AIX Commands Reference SETMAPS(1,C) \$ \@ \\ Prevents the pattern processor from interpreting $, @, or \ as special characters. \ddd Represents any byte in octal notation. \xdd Represents any byte in hexadecimal notation. FLAGS -i mapname Selects /etc/nls/termmap/mapname.in as the input map. The superuser must load maps into the kernel, usually at system startup time, for the maps to be available to users. -I mapname Selects mapname as the input map, where mapname is a file residing in the current directory. You must have superuser authority to specify this flag. -o mapname Selects /etc/nls/termmap/mapname.out as the output map. The superuser must load maps into the kernel, usually at system startup time, for the maps to be available to users. -O mapname Selects mapname as the output map, where mapname is a file residing in the current directory. You must have superuser authority to specify this flag. -t mapname Selects /etc/nls/termmap/mapname.in as the input map and /etc/nls/termmap/mapname.out as the output map. The superuser must load maps into the kernel, usually at system startup time, for the maps to be available to users. -k keyname Associates the specified keyname with the map being selected (see "stty, STTY"). This key name overrides the default key, which is normally set to the value of mapname. You must have superuser authority to specify this flag. -r mapname Specifies that the kernel is to reload the specified map file. Terminals using the old map will 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. You must have superuser authority to specify this flag. -h Display help message. -c Clears all mapping for the terminal. Processed August 22, 1991 SETMAPS(1,C) 3 SETMAPS(1,C) AIX Commands Reference SETMAPS(1,C) EXAMPLES 1. To set your terminal input and output map for a VT220 terminal or a VT220 terminal emulator (such as the AADU em command): setmaps -t vt220 2. To set your terminal input and output map for an IBM3161 terminal: setmaps -t ibm3161 -c FILES /etc/nls/termmap/*.in Input map files. /etc/nls/termmap/*.out Output map files. RELATED INFORMATION See the following commands: "ctab" and "stty, STTY." See the ports and termio files in AIX Operating System Technical Reference. See "Overview of International Character Support" in Managing the AIX Operating System. Processed August 22, 1991 SETMAPS(1,C) 4