1996-05-05 19:01:13 +00:00
|
|
|
.\" Copyright (c) 1983, 1991, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
1994-05-27 12:39:25 +00:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
2014-02-17 22:27:32 +00:00
|
|
|
.\" 3. Neither the name of the University nor the names of its contributors
|
1994-05-27 12:39:25 +00:00
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1996-05-05 19:01:13 +00:00
|
|
|
.\" from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1996-05-05 19:01:13 +00:00
|
|
|
.\" "
|
Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8)
There is one capability explicitly documented in gettytab(5) as stupid: he.
And it is indeed. It was meant to facilitate system hostname modification,
but is hardly usable in practice because it allows very limited editing
(e.g., it depends on a particular hostname length, making it non-generic).
Replace it with simple implementation that treats ``he'' as POSIX extended
regular expression which is matched against the hostname. If there are no
parenthesized subexpressions in the pattern, entire matched string is used
as the final hostname. Otherwise, use the first matched subexpression.
If the pattern does not match, the original hostname is not modified.
Using regex(3) gives more freedom, does not complicate the code very much,
and makes a lot more sense, in turn making ``he'' less stupid and actually
useful (e.g., it is now possible to obtain node or domain names from the
original hostname string, without knowing it in advance).
Reviewed by: jilles, manpages (wblock)
Approved by: jilles (implied)
Differential Revision: https://reviews.freebsd.org/D9244
2017-02-02 20:30:50 +00:00
|
|
|
.Dd February 2, 2017
|
1994-05-27 12:39:25 +00:00
|
|
|
.Dt GETTYTAB 5
|
2001-07-10 10:49:54 +00:00
|
|
|
.Os
|
1994-05-27 12:39:25 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm gettytab
|
|
|
|
.Nd terminal configuration data base
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 14:42:24 +00:00
|
|
|
.Nm
|
1994-05-27 12:39:25 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
1997-11-21 07:43:53 +00:00
|
|
|
.Nm
|
1994-05-27 12:39:25 +00:00
|
|
|
file
|
|
|
|
is a simplified version of the
|
|
|
|
.Xr termcap 5
|
|
|
|
data base
|
|
|
|
used to describe terminal lines.
|
|
|
|
The initial terminal login process
|
|
|
|
.Xr getty 8
|
|
|
|
accesses the
|
1997-11-21 07:43:53 +00:00
|
|
|
.Nm
|
1994-05-27 12:39:25 +00:00
|
|
|
file each time it starts, allowing simpler
|
|
|
|
reconfiguration of terminal characteristics.
|
|
|
|
Each entry in the data base
|
|
|
|
is used to describe one class of terminals.
|
|
|
|
.Pp
|
|
|
|
There is a default terminal class,
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va default ,
|
1994-05-27 12:39:25 +00:00
|
|
|
that is used to set global defaults for all other classes.
|
|
|
|
(That is, the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va default
|
1994-05-27 12:39:25 +00:00
|
|
|
entry is read, then the entry for the class required
|
|
|
|
is used to override particular settings.)
|
|
|
|
.Sh CAPABILITIES
|
|
|
|
Refer to
|
|
|
|
.Xr termcap 5
|
|
|
|
for a description of the file layout.
|
|
|
|
The
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va default
|
1994-05-27 12:39:25 +00:00
|
|
|
column below lists defaults obtained if there is
|
|
|
|
no entry in the table obtained, nor one in the special
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va default
|
1994-05-27 12:39:25 +00:00
|
|
|
table.
|
2000-12-20 13:26:01 +00:00
|
|
|
.Bl -column Name Type /usr/bin/login
|
2012-03-26 15:18:14 +00:00
|
|
|
.It Sy "Name Type Default Description"
|
1997-02-02 14:24:57 +00:00
|
|
|
.It "ac str unused expect-send chat script for modem answer"
|
1999-04-04 04:36:50 +00:00
|
|
|
.It "al str unused user to auto-login instead of prompting"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "ap bool false terminal uses any parity"
|
|
|
|
.It "bk str 0377 alternate end of line character (input break)"
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "c0 num unused tty control flags to write messages"
|
|
|
|
.It "c1 num unused tty control flags to read login name"
|
|
|
|
.It "c2 num unused tty control flags to leave terminal as"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "ce bool false use crt erase algorithm"
|
|
|
|
.It "ck bool false use crt kill algorithm"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "cl str" Ta Dv NULL
|
|
|
|
.Ta No "screen clear sequence"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "co bool false console - add"
|
|
|
|
.Ql \en
|
|
|
|
after login prompt
|
2003-06-10 14:46:43 +00:00
|
|
|
.It "ct num 10 chat timeout for"
|
|
|
|
.Va \&ac
|
|
|
|
and
|
|
|
|
.Va \&ic
|
|
|
|
scripts
|
1997-02-02 14:24:57 +00:00
|
|
|
.It "dc num 0 chat debug bitmask"
|
|
|
|
.It "de num 0 delay secs and flush input before writing first prompt"
|
2001-06-07 13:53:23 +00:00
|
|
|
.It "df str %+ the" Xr strftime 3 "format used for \&%d in the banner message"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "ds str" Ta So Li ^Y
|
|
|
|
.Sc Ta No "delayed suspend character"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "dx bool false set"
|
|
|
|
.Dv DECCTLQ
|
|
|
|
.It "ec bool false leave echo"
|
2003-06-10 14:46:43 +00:00
|
|
|
.Em OFF
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "ep bool false terminal uses even parity"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "er str" Ta So Li ^?
|
|
|
|
.Sc Ta No "erase character"
|
|
|
|
.It "et str" Ta So Li ^D
|
|
|
|
.Sc Ta No "end of text"
|
1994-05-27 12:39:25 +00:00
|
|
|
.Pq Dv EOF
|
|
|
|
character
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "ev str" Ta Dv NULL
|
|
|
|
.Ta No "initial environment"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "f0 num unused tty mode flags to write messages"
|
|
|
|
.It "f1 num unused tty mode flags to read login name"
|
|
|
|
.It "f2 num unused tty mode flags to leave terminal as"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "fl str" Ta So Li ^O
|
|
|
|
.Sc Ta No "output flush character"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "hc bool false do"
|
2003-06-10 14:46:43 +00:00
|
|
|
.Em NOT
|
1994-05-27 12:39:25 +00:00
|
|
|
hangup line on last close
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "he str" Ta Dv NULL
|
|
|
|
.Ta No "hostname editing regular expression"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "hn str hostname hostname"
|
|
|
|
.It "ht bool false terminal has real tabs"
|
1997-02-02 14:24:57 +00:00
|
|
|
.It "hw bool false do cts/rts hardware flow control"
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "i0 num unused tty input flags to write messages"
|
|
|
|
.It "i1 num unused tty input flags to read login name"
|
|
|
|
.It "i2 num unused tty input flags to leave terminal as"
|
1997-02-02 14:24:57 +00:00
|
|
|
.It "ic str unused expect-send chat script for modem initialization"
|
1998-05-04 02:37:29 +00:00
|
|
|
.It "if str unused display named file before prompt, like /etc/issue"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "ig bool false ignore garbage characters in login name"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "im str" Ta Dv NULL
|
|
|
|
.Ta No "initial (banner) message"
|
|
|
|
.It "in str" Ta So Li ^C
|
|
|
|
.Sc Ta No "interrupt character"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "is num unused input speed"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "kl str" Ta So Li ^U
|
|
|
|
.Sc Ta No "kill character"
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "l0 num unused tty local flags to write messages"
|
|
|
|
.It "l1 num unused tty local flags to read login name"
|
|
|
|
.It "l2 num unused tty local flags to leave terminal as"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "lm str login: login prompt"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "ln str" Ta So Li ^V
|
|
|
|
.Sc Ta No "``literal next'' character"
|
|
|
|
.It "lo str" Ta Pa /usr/bin/login
|
|
|
|
.Ta No "program to exec when name obtained"
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "mb bool false do flow control based on carrier"
|
2000-07-31 23:47:57 +00:00
|
|
|
.It "nc bool false terminal does not supply carrier (set clocal)"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "nl bool false terminal has (or might have) a newline character"
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "np bool false terminal uses no parity (i.e. 8-bit characters)"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "nx str default next table (for auto speed selection)"
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "o0 num unused tty output flags to write messages"
|
|
|
|
.It "o1 num unused tty output flags to read login name"
|
|
|
|
.It "o2 num unused tty output flags to leave terminal as"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "op bool false terminal uses odd parity"
|
|
|
|
.It "os num unused output speed"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "pc str" Ta So Li \e0
|
|
|
|
.Sc Ta No "pad character"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "pe bool false use printer (hard copy) erase algorithm"
|
|
|
|
.It "pf num 0 delay"
|
|
|
|
between first prompt and following flush (seconds)
|
2003-06-17 12:29:36 +00:00
|
|
|
.It "pl bool false start PPP login program unconditionally if"
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&pp
|
2003-06-10 14:20:38 +00:00
|
|
|
is specified
|
|
|
|
.It "pp str unused PPP login program"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "ps bool false line connected to a"
|
|
|
|
.Tn MICOM
|
|
|
|
port selector
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "qu str" Ta So Li \&^\e
|
|
|
|
.Sc Ta No "quit character"
|
|
|
|
.It "rp str" Ta So Li ^R
|
|
|
|
.Sc Ta No "line retype character"
|
2003-06-10 14:46:43 +00:00
|
|
|
.It "rt num unused ring timeout when using"
|
|
|
|
.Va \&ac
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "rw bool false do"
|
2003-06-10 14:46:43 +00:00
|
|
|
.Em NOT
|
1994-05-27 12:39:25 +00:00
|
|
|
use raw for input, use cbreak
|
|
|
|
.It "sp num unused line speed (input and output)"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "su str" Ta So Li ^Z
|
|
|
|
.Sc Ta No "suspend character"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "tc str none table continuation"
|
|
|
|
.It "to num 0 timeout (seconds)"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "tt str" Ta Dv NULL
|
|
|
|
.Ta No "terminal type (for environment)"
|
1994-05-27 12:39:25 +00:00
|
|
|
.It "ub bool false do unbuffered output (of prompts etc)"
|
2017-05-04 19:01:17 +00:00
|
|
|
.It "we str" Ta So Li ^W
|
|
|
|
.Sc Ta No "word erase character"
|
2012-03-26 15:18:14 +00:00
|
|
|
.It "xc bool false do"
|
2003-06-10 14:46:43 +00:00
|
|
|
.Em NOT
|
1994-05-27 12:39:25 +00:00
|
|
|
echo control chars as
|
|
|
|
.Ql ^X
|
|
|
|
.It "xf str" Ta So Li ^S Sc Ta Dv XOFF
|
|
|
|
(stop output) character
|
|
|
|
.It "xn str" Ta So Li ^Q Sc Ta Dv XON
|
|
|
|
(start output) character
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "Lo str C the locale name used for \&%d in the banner message"
|
|
|
|
.El
|
|
|
|
.Pp
|
1997-11-21 07:43:53 +00:00
|
|
|
The following capabilities are no longer supported by
|
2002-08-13 16:07:28 +00:00
|
|
|
.Xr getty 8 :
|
2000-12-20 13:26:01 +00:00
|
|
|
.Bl -column Name Type /usr/bin/login
|
1996-05-05 19:01:13 +00:00
|
|
|
.It "bd num 0 backspace delay"
|
|
|
|
.It "cb bool false use crt backspace mode"
|
|
|
|
.It "cd num 0 carriage-return delay"
|
|
|
|
.It "fd num 0 form-feed (vertical motion) delay"
|
|
|
|
.It "lc bool false terminal has lower case"
|
|
|
|
.It "nd num 0 newline (line-feed) delay"
|
|
|
|
.It "uc bool false terminal is known upper case only"
|
1994-05-27 12:39:25 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
If no line speed is specified, speed will not be altered
|
|
|
|
from that which prevails when getty is entered.
|
|
|
|
Specifying an input or output speed will override
|
|
|
|
line speed for stated direction only.
|
|
|
|
.Pp
|
|
|
|
Terminal modes to be used for the output of the message,
|
|
|
|
for input of the login name,
|
|
|
|
and to leave the terminal set as upon completion,
|
|
|
|
are derived from the boolean flags specified.
|
|
|
|
If the derivation should prove inadequate,
|
|
|
|
any (or all) of these three may be overridden
|
|
|
|
with one of the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&c0 ,
|
|
|
|
.Va \&c1 ,
|
|
|
|
.Va \&c2 ,
|
|
|
|
.Va \&i0 ,
|
|
|
|
.Va \&i1 ,
|
|
|
|
.Va \&i2 ,
|
|
|
|
.Va \&l0 ,
|
|
|
|
.Va \&l1 ,
|
|
|
|
.Va \&l2 ,
|
|
|
|
.Va \&o0 ,
|
|
|
|
.Va \&o1 ,
|
1994-05-27 12:39:25 +00:00
|
|
|
or
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&o2
|
1994-05-27 12:39:25 +00:00
|
|
|
numeric specifications, which can be used to specify
|
|
|
|
(usually in octal, with a leading '0')
|
|
|
|
the exact values of the flags.
|
1996-05-05 19:01:13 +00:00
|
|
|
These flags correspond to the termios
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va c_cflag ,
|
|
|
|
.Va c_iflag ,
|
|
|
|
.Va c_lflag ,
|
1996-05-05 19:01:13 +00:00
|
|
|
and
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va c_oflag
|
2003-06-10 15:03:35 +00:00
|
|
|
fields, respectively.
|
|
|
|
Each these sets must be completely specified to be effective.
|
1996-05-05 19:01:13 +00:00
|
|
|
The
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&f0 ,
|
|
|
|
.Va \&f1 ,
|
1996-05-05 19:01:13 +00:00
|
|
|
and
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&f2
|
1996-05-05 19:01:13 +00:00
|
|
|
are excepted for backwards compatibility with a previous incarnation of
|
2003-06-10 15:03:35 +00:00
|
|
|
the TTY sub-system.
|
|
|
|
In these flags the bottom 16 bits of the (32 bits)
|
1996-05-05 19:01:13 +00:00
|
|
|
value contain the sgttyb
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va sg_flags
|
1996-05-05 19:01:13 +00:00
|
|
|
field, while the top 16 bits represent the local mode word.
|
1994-05-27 12:39:25 +00:00
|
|
|
.Pp
|
|
|
|
Should
|
1996-05-05 19:01:13 +00:00
|
|
|
.Xr getty 8
|
1994-05-27 12:39:25 +00:00
|
|
|
receive a null character
|
|
|
|
(presumed to indicate a line break)
|
|
|
|
it will restart using the table indicated by the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&nx
|
2003-06-10 15:03:35 +00:00
|
|
|
entry.
|
|
|
|
If there is none, it will re-use its original table.
|
1994-05-27 12:39:25 +00:00
|
|
|
.Pp
|
|
|
|
Delays are specified in milliseconds, the nearest possible
|
|
|
|
delay available in the tty driver will be used.
|
|
|
|
Should greater certainty be desired, delays
|
|
|
|
with values 0, 1, 2, and 3 are interpreted as
|
|
|
|
choosing that particular delay algorithm from the driver.
|
|
|
|
.Pp
|
|
|
|
The
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&cl
|
1994-05-27 12:39:25 +00:00
|
|
|
screen clear string may be preceded by a (decimal) number
|
|
|
|
of milliseconds of delay required (a la termcap).
|
|
|
|
This delay is simulated by repeated use of the pad character
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&pc .
|
1994-05-27 12:39:25 +00:00
|
|
|
.Pp
|
1998-05-04 02:37:29 +00:00
|
|
|
The initial message, login message, and initial file;
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&im ,
|
|
|
|
.Va \&lm
|
1998-05-04 02:37:29 +00:00
|
|
|
and
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&if
|
1996-05-05 19:01:13 +00:00
|
|
|
may include any of the following character sequences, which expand to
|
|
|
|
information about the environment in which
|
|
|
|
.Xr getty 8
|
|
|
|
is running.
|
1997-02-02 14:24:57 +00:00
|
|
|
.Bl -tag -offset indent -width \&%xxxxxxxxxxxxxx
|
1996-05-05 19:01:13 +00:00
|
|
|
.It \&%d
|
2001-06-07 13:53:23 +00:00
|
|
|
The current date and time formatted according to the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&Lo
|
2001-06-07 13:53:23 +00:00
|
|
|
and
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&df
|
2001-06-07 13:53:23 +00:00
|
|
|
strings.
|
1996-05-05 19:01:13 +00:00
|
|
|
.It \&%h
|
|
|
|
The hostname of the machine, which is normally obtained from the
|
|
|
|
system using
|
1996-12-14 23:27:20 +00:00
|
|
|
.Xr gethostname 3 ,
|
1996-05-05 19:01:13 +00:00
|
|
|
but may also be overridden by the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&hn
|
1994-05-27 12:39:25 +00:00
|
|
|
table entry.
|
1996-05-05 19:01:13 +00:00
|
|
|
In either case it may be edited with the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&he
|
Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8)
There is one capability explicitly documented in gettytab(5) as stupid: he.
And it is indeed. It was meant to facilitate system hostname modification,
but is hardly usable in practice because it allows very limited editing
(e.g., it depends on a particular hostname length, making it non-generic).
Replace it with simple implementation that treats ``he'' as POSIX extended
regular expression which is matched against the hostname. If there are no
parenthesized subexpressions in the pattern, entire matched string is used
as the final hostname. Otherwise, use the first matched subexpression.
If the pattern does not match, the original hostname is not modified.
Using regex(3) gives more freedom, does not complicate the code very much,
and makes a lot more sense, in turn making ``he'' less stupid and actually
useful (e.g., it is now possible to obtain node or domain names from the
original hostname string, without knowing it in advance).
Reviewed by: jilles, manpages (wblock)
Approved by: jilles (implied)
Differential Revision: https://reviews.freebsd.org/D9244
2017-02-02 20:30:50 +00:00
|
|
|
POSIX
|
|
|
|
.Dq extended
|
|
|
|
regular expression, which is matched against the hostname.
|
|
|
|
If there are no parenthesized subexpressions in the pattern,
|
|
|
|
the entire matched string is used as the final hostname;
|
|
|
|
otherwise, the first matched subexpression is used instead.
|
|
|
|
If the pattern does not match, the original hostname is not modified.
|
1996-05-05 19:01:13 +00:00
|
|
|
.It \&%t
|
|
|
|
The tty name.
|
|
|
|
.It "\&%m, \&%r, \&%s, \&%v"
|
|
|
|
The type of machine, release of the operating system, name of the
|
|
|
|
operating system, and version of the kernel, respectively, as
|
|
|
|
returned by
|
1996-12-14 23:27:20 +00:00
|
|
|
.Xr uname 3 .
|
1996-05-05 19:01:13 +00:00
|
|
|
.It \&%%
|
|
|
|
A
|
|
|
|
.Dq %
|
|
|
|
character.
|
|
|
|
.El
|
1994-05-27 12:39:25 +00:00
|
|
|
.Pp
|
|
|
|
When getty execs the login process, given
|
|
|
|
in the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&lo
|
1994-05-27 12:39:25 +00:00
|
|
|
string (usually
|
|
|
|
.Dq Pa /usr/bin/login ) ,
|
|
|
|
it will have set
|
|
|
|
the environment to include the terminal type, as indicated
|
|
|
|
by the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&tt
|
1994-05-27 12:39:25 +00:00
|
|
|
string (if it exists).
|
|
|
|
The
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&ev
|
1994-05-27 12:39:25 +00:00
|
|
|
string, can be used to enter additional data into
|
|
|
|
the environment.
|
|
|
|
It is a list of comma separated strings, each of which
|
|
|
|
will presumably be of the form
|
2003-06-10 14:46:43 +00:00
|
|
|
.Li name=value .
|
1994-05-27 12:39:25 +00:00
|
|
|
.Pp
|
|
|
|
If a non-zero timeout is specified, with
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&to ,
|
1994-05-27 12:39:25 +00:00
|
|
|
then getty will exit within the indicated
|
|
|
|
number of seconds, either having
|
|
|
|
received a login name and passed control
|
|
|
|
to
|
1996-05-05 19:01:13 +00:00
|
|
|
.Xr login 1 ,
|
1994-05-27 12:39:25 +00:00
|
|
|
or having received an alarm signal, and exited.
|
|
|
|
This may be useful to hangup dial in lines.
|
|
|
|
.Pp
|
|
|
|
Output from
|
1996-05-05 19:01:13 +00:00
|
|
|
.Xr getty 8
|
1994-05-27 12:39:25 +00:00
|
|
|
is even parity unless
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&op
|
1996-05-05 19:01:13 +00:00
|
|
|
or
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&np
|
1994-05-27 12:39:25 +00:00
|
|
|
is specified.
|
|
|
|
The
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&op
|
1994-05-27 12:39:25 +00:00
|
|
|
string
|
|
|
|
may be specified with
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&ap
|
1994-05-27 12:39:25 +00:00
|
|
|
to allow any parity on input, but generate odd parity output.
|
|
|
|
Note: this only applies while getty is being run,
|
|
|
|
terminal driver limitations prevent a more complete
|
|
|
|
implementation.
|
2003-06-08 12:38:18 +00:00
|
|
|
The
|
|
|
|
.Xr getty 8
|
|
|
|
utility does not check parity of input characters in
|
1994-05-27 12:39:25 +00:00
|
|
|
.Dv RAW
|
|
|
|
mode.
|
1996-11-13 01:06:40 +00:00
|
|
|
.Pp
|
2003-06-10 14:20:38 +00:00
|
|
|
If a
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&pp
|
2003-06-10 14:20:38 +00:00
|
|
|
string is specified and a PPP link bring-up sequence is recognized,
|
|
|
|
getty will invoke the program referenced by the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&pp
|
2003-06-10 14:20:38 +00:00
|
|
|
option.
|
|
|
|
This can be used to handle incoming PPP calls.
|
|
|
|
If the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&pl
|
2003-06-10 14:20:38 +00:00
|
|
|
option is true as well,
|
|
|
|
.Xr getty 8
|
|
|
|
will skip the user name prompt and the PPP detection phase, and will
|
|
|
|
invoke the program specified by
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&pp
|
2003-06-10 14:20:38 +00:00
|
|
|
instantly.
|
1997-02-02 14:24:57 +00:00
|
|
|
.Pp
|
1997-11-21 07:43:53 +00:00
|
|
|
.Nm Getty
|
1997-02-02 14:24:57 +00:00
|
|
|
provides some basic intelligent modem handling by providing a chat
|
|
|
|
script feature available via two capabilities:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -offset indent -width \&xxxxxxxx -compact
|
|
|
|
.It ic
|
|
|
|
Chat script to initialize modem.
|
|
|
|
.It ac
|
|
|
|
Chat script to answer a call.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
A chat script is a set of expect/send string pairs.
|
|
|
|
When a chat string starts,
|
1997-11-21 07:43:53 +00:00
|
|
|
.Nm getty
|
1997-02-02 14:24:57 +00:00
|
|
|
will wait for the first string, and if it finds it, will send the
|
|
|
|
second, and so on.
|
|
|
|
Strings specified are separated by one or more tabs or spaces.
|
1999-09-20 09:15:23 +00:00
|
|
|
Strings may contain standard ASCII characters and special 'escapes',
|
1997-02-02 14:24:57 +00:00
|
|
|
which consist of a backslash character followed by one or more
|
|
|
|
characters which are interpreted as follows:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -offset indent -width \&xxxxxxxx -compact
|
|
|
|
.It \ea
|
|
|
|
bell character.
|
|
|
|
.It \eb
|
|
|
|
backspace.
|
|
|
|
.It \en
|
|
|
|
newline.
|
|
|
|
.It \ee
|
|
|
|
escape.
|
|
|
|
.It \ef
|
|
|
|
formfeed.
|
|
|
|
.It \ep
|
|
|
|
half-second pause.
|
|
|
|
.It \er
|
|
|
|
carriage return.
|
2001-02-01 16:38:02 +00:00
|
|
|
.It \eS , \es
|
1997-02-02 14:24:57 +00:00
|
|
|
space character.
|
|
|
|
.It \et
|
|
|
|
tab.
|
|
|
|
.It \exNN
|
|
|
|
hexadecimal byte value.
|
|
|
|
.It \e0NNN
|
|
|
|
octal byte value.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Note that the
|
|
|
|
.Ql \ep
|
|
|
|
sequence is only valid for send strings and causes a half-second
|
|
|
|
pause between sending the previous and next characters.
|
2002-12-27 12:15:40 +00:00
|
|
|
Hexadecimal values are, at most, 2 hex digits long, and octal
|
1997-02-02 14:24:57 +00:00
|
|
|
values are a maximum of 3 octal digits.
|
|
|
|
.Pp
|
|
|
|
The
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&ic
|
1997-02-02 14:24:57 +00:00
|
|
|
chat sequence is used to initialize a modem or similar device.
|
|
|
|
A typical example of an init chat script for a modem with a
|
|
|
|
hayes compatible command set might look like this:
|
|
|
|
.Pp
|
|
|
|
.Dl :ic="" ATE0Q0V1\er OK\er ATS0=0\er OK\er:
|
|
|
|
.Pp
|
|
|
|
This script waits for nothing (which always succeeds), sends
|
|
|
|
a sequence to ensure that the modem is in the correct mode
|
|
|
|
(suppress command echo, send responses in verbose mode),
|
|
|
|
and then disables auto-answer.
|
|
|
|
It waits for an "OK" response before it terminates.
|
|
|
|
The init sequence is used to check modem responses to ensure that
|
|
|
|
the modem is functioning correctly.
|
|
|
|
If the init script fails to complete,
|
|
|
|
.Nm getty
|
|
|
|
considers this to be fatal, and results in an error logged via
|
|
|
|
.Xr syslogd 8 ,
|
|
|
|
and exiting.
|
|
|
|
.Pp
|
|
|
|
Similarly, an answer chat script is used to manually answer the
|
|
|
|
phone in response to (usually) a "RING".
|
|
|
|
When run with an answer script,
|
|
|
|
.Nm getty
|
|
|
|
opens the port in non-blocking mode, clears any extraneous input
|
|
|
|
and waits for data on the port.
|
|
|
|
As soon as any data is available, the answer chat script is
|
|
|
|
started and scanned for a string, and responds according to
|
|
|
|
the answer chat script.
|
|
|
|
With a hayes compatible modem, this would normally look something
|
|
|
|
like:
|
|
|
|
.Pp
|
|
|
|
.Dl :ac=RING\er ATA\er CONNECT:
|
|
|
|
.Pp
|
|
|
|
This causes the modem to answer the call via the "ATA" command,
|
|
|
|
then scans input for a "CONNECT" string.
|
|
|
|
If this is received before a
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&ct
|
|
|
|
timeout, then a normal login sequence commences.
|
1997-02-02 14:24:57 +00:00
|
|
|
.Pp
|
|
|
|
The
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&ct
|
1997-02-02 14:24:57 +00:00
|
|
|
capability specifies a timeout for all send and expect strings.
|
|
|
|
This timeout is set individually for each expect wait and send
|
|
|
|
string and must be at least as long as the time it takes for
|
|
|
|
a connection to be established between a remote and local
|
|
|
|
modem (usually around 10 seconds).
|
|
|
|
.Pp
|
|
|
|
In most situations, you will want to flush any additional
|
|
|
|
input after the connection has been detected, and the
|
2003-06-10 14:46:43 +00:00
|
|
|
.Va \&de
|
1997-02-02 14:24:57 +00:00
|
|
|
capability may be used to do that, as well as delay for a
|
|
|
|
short time after the connection has been established during
|
|
|
|
which all of the connection data has been sent by the modem.
|
1994-05-27 12:39:25 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr login 1 ,
|
1996-12-14 23:27:20 +00:00
|
|
|
.Xr gethostname 3 ,
|
|
|
|
.Xr uname 3 ,
|
1994-05-27 12:39:25 +00:00
|
|
|
.Xr termcap 5 ,
|
1997-02-02 14:24:57 +00:00
|
|
|
.Xr getty 8 ,
|
2000-11-15 17:27:54 +00:00
|
|
|
.Xr telnetd 8
|
2005-01-18 09:29:40 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
file format appeared in
|
|
|
|
.Bx 4.2 .
|
1994-05-27 12:39:25 +00:00
|
|
|
.Sh BUGS
|
|
|
|
The special characters (erase, kill, etc.) are reset to system defaults
|
|
|
|
by
|
|
|
|
.Xr login 1 .
|
|
|
|
In
|
|
|
|
.Em all
|
|
|
|
cases, '#' or '^H' typed in a login name will be treated as
|
|
|
|
an erase character, and '@' will be treated as a kill character.
|
|
|
|
.Pp
|
|
|
|
The delay stuff is a real crock.
|
|
|
|
Apart form its general lack of flexibility, some
|
|
|
|
of the delay algorithms are not implemented.
|
|
|
|
The terminal driver should support sane delay settings.
|
|
|
|
.Pp
|
|
|
|
The
|
1997-11-21 07:43:53 +00:00
|
|
|
.Xr termcap 5
|
1994-05-27 12:39:25 +00:00
|
|
|
format is horrid, something more rational should
|
|
|
|
have been chosen.
|