| 1 |
.TH CONSOLETYPE 1 "Red Hat, Inc" "RH" \" -*- nroff -*- |
| 2 |
.SH NAME |
| 3 |
\fBconsoletype |
| 4 |
\- print type of the console connected to standard input |
| 5 |
.SH SYNOPSIS |
| 6 |
\fBconsoletype [\fIstdout\fR] [\fIfg\fR] |
| 7 |
.SH DESCRIPTION |
| 8 |
\fBconsoletype |
| 9 |
prints the type of console connected to standard input, and checks |
| 10 |
whether the console connected to standard input is the current |
| 11 |
foreground virtual console. With no arguments, it prints |
| 12 |
\fIvt\fR |
| 13 |
if console is a virtual terminal (/dev/tty* or /dev/console device if not on |
| 14 |
a serial console), |
| 15 |
\fIserial\fR |
| 16 |
if standard input is a serial console (/dev/console or /dev/ttyS*) and |
| 17 |
\fIpty\fR |
| 18 |
if standard input is a pseudo terminal. |
| 19 |
.SH RETURN VALUE |
| 20 |
\fBconsoletype |
| 21 |
when passed no arguments returns |
| 22 |
.TP |
| 23 |
\fI0 |
| 24 |
if on virtual terminal |
| 25 |
.TP |
| 26 |
\fI1 |
| 27 |
if on serial console |
| 28 |
.TP |
| 29 |
\fI2 |
| 30 |
if on a pseudo terminal. |
| 31 |
.TP |
| 32 |
When passed the \fIstdout\fR argument, \fBconsoletype\fR returns |
| 33 |
.TP |
| 34 |
\fI0 |
| 35 |
in all cases, and prints the console type to stdout. |
| 36 |
.TP |
| 37 |
When passed the \fIfg\fR argument, \fBconsoletype\fR returns |
| 38 |
.TP |
| 39 |
\fI0 |
| 40 |
if the console connected to standard input is the current virtual |
| 41 |
terminal |
| 42 |
.TP |
| 43 |
\fI1 |
| 44 |
otherwise. |