getty(1M)getty(1M)NAMEgetty - set terminal type, modes, speed, and line discipline
timeout] line [speed [type [linedesc]]]
The program is invoked by (see init(1M)), as the second process in the
series, > > > shell, that ultimately connects a user with the HP-UX
sets the terminal speed and characteristics and prompts for the user's
login information before passing control to the program. See below for
recognizes the following options:
Scan and test file for conformance with the specifications in
the gettydefs(4) manpage, print the results on
standard output, and terminate. All other argu‐
ments are ignored.
Any unrecognized modes or improperly constructed
entries are reported as errors. For correct
entries, prints out the values of the various
flags. See ioctl(2) for an interpretation of
values. Note that some values are added to the
Get the settings for special control characters from the
file. See the section.
Do not force a hangup on the line before setting the speed.
By default, forces a hangup on the line by set‐
ting the speed to zero before setting the speed
to the default or specified speed. However, when
is run on a direct port, does not force a hangup
on the line since the driver ignores changes to
zero speed on ports open in direct mode (see
Exit if the open on the line succeeds
and no one types anything within timeout seconds.
The default is to wait indefinitely.
recognizes the following operands:
line The name of a tty device file in to which is to
attach itself. opens file for reading and writ‐
speed A label for a speed and tty definition in the
file See gettydefs(4).
This definition tells at what speed to run ini‐
tially, what the login message should look like,
what the initial tty settings are, and what speed
to try next if the user indicates that the speed
is inappropriate by typing a break character.
The default speed is the first entry in or 300
baud if is missing or unusable.
type A character string describing what type of termi‐
nal is connected to the line in question. under‐
stands the following types:
c100 Concept 100
hp45 Hewlett-Packard HP2645
vt61 DEC vt61
vt100 DEC vt100
The default terminal is that is, any CRT or nor‐
mal terminal unknown to the system. Also, for
terminal type to have any meaning, the virtual
terminal handlers must be compiled into the oper‐
ating system. They are available, but not com‐
piled, in the default condition.
linedesc A character string describing which line disci‐
pline to use when communicating with the termi‐
nal. Hooks for line disciplines are available in
the operating system, but there is only one
presently available: the default line discipline,
With the option, tests file against the rules for (see gettydefs(4)),
prints error messages and flag values to standard output, and termi‐
This is a good way to test a revised file before putting it into opera‐
Without the option, opens the port interface for line, sets the speed,
terminal parameters, and login message, prompts for login information,
and passes control to the program, as follows.
1. determines the speed, terminal parameters, and login message.
· If the speed operand is given, selects that entry from and
sets the terminal parameters and login message to the given
· If speed is not found in or the speed operand is omitted,
selects the first entry from and sets the terminal parameters
and login message to the given values.
· If is missing or unreadable or has errors, sets the speed of
the interface to 300 baud, sets the login message to and sets
the terminal parameters to: use raw mode (awaken on every
character), suppress echo, allow either parity, convert new‐
line characters to carriage-return-linefeed, and perform tab
expansion on standard output,
· If type or linedesc is given, the terminal parameters are
· The special control characters are defined. If the option is
given, they are read from the file. See the section for
· connects to the terminal port, applying all the terminal
parameters. It forces a hangup on the line by setting the
speed to zero, except if the port is opened in direct mode or
if the option was specified.
2. prompts for and reads a line of login information.
· If the file exists, it is displayed.
· The login message is displayed.
· reads the user name and optional arguments from the port.
The one-line parsed input is limited to 255 characters and 64
whitespace-delimited words. The special control characters
affect the input. See the section for detail.
If a null character or a framing error is received, it is
assumed to be the result of the user pushing the break key.
This causes to attempt the next speed in the current series,
repeating step 1.
The input line is terminated with a newline or carriage
return character. If the latter, the system is set to
receive carriage returns appropriately (see termio(7)).
The user's name is scanned to see if it contains any lower‐
case alphabetic characters. If it does not, and if the name
is nonempty, the system is told to map any future uppercase
characters into the corresponding lowercase characters.
3. passes control to
· passes the parsed user name and optional arguments, along
with the terminal parameters, to the program (see exec(2)).
· performs user validation (for example, password processing)
and login retries, places the optional arguments in environ‐
ment variables, and passes control to the shell. See
login(1) for details.
4. On termination, control returns to
· When or or the shell terminate for any reason, control
· If the action is defined for the device file in reruns the
command, and the process resumes at step 1 (see inittab(4)).
Special Control Characters
The program uses special control characters to manage text input and to
switch line speeds.
The default special control characters are shown in the following ta‐
Table 1: Default Special Control Characters
May Be Character, or ASCII Value
Name Quoted (ASCII Name; Key Names) Action
eof Yes ^D (EOT) Terminate getty
erase Yes # Erase previous character
intr No 127 (DEL; Delete) Erase entire input line
kill Yes @ Erase entire input line
quit No ^\ (FS) Terminate getty
break No \0 (NUL or framing error) Switch to next entry
lineend No ^J (NL; newline) Terminate input line
lineend No ^M (CR; carriage return) Terminate input line
quote Yes \ Quote next character
You can set different values for and some other terminal parameters by
modifying the file. A superuser may view and modify with the command.
See stty(1) for details.
To use the values in specify the option on the command line. under‐
stands the single character quoting convention using the backslash
quote. This allows you to include whitespace, some of the special con‐
trol characters, and some of the general control characters, in the
input line as ordinary text. You cannot quote the current values of
the special control character names that are marked "No" in the May Be
Quoted column. The single and double quotation marks and ) have no
special meaning (unless they are assigned in
The modem control parameter must be present in the file when using in
conjunction with an HP2334 or HP2335 MultiMux to ensure that the RTS
modem control signal is asserted correctly.
is not intended for use with devices other than the HP2334 or HP2335
FILESSEE ALSOct(1), login(1), stty(1), init(1M), ioctl(2), gettydefs(4), inittab(4),