.TH ttystat "" "" Command
.PC "Get terminal status"
\fB/etc/ttystat [ \-d ] \fIport\fR
.PP
.HS
.SH Option:
.IC "\fB\-d\fR"
Print status of \fIport\fR
.Pp
Returns exit status 1 if specified port is enabled, 0 if disabled.
Prints nothing unless \fB\-d\fR option specified.
.HE
.B ttystat
checks the status of the specified asynchronous
.I port 
in directory
.BR /dev .
It normally just returns an exit status that indicates the status of the
.IR port .
The option
.B \-d
tells
.B ttystat
to print the status of the
.I port
on the standard output.
.SH Example
The following example prints
the status of port
.BR /dev/com2r :
.DM
	/etc/ttystat -d com2
.DE
.PP
If
.B /dev/com2r
is enabled,
.B ttystat
prints:
.DM
	com2r is enabled
.DE
.PP
.B ttystat
finds the port status from the
.B /etc/ttys
file.
.SH Files
\fB/etc/ttys\fR \(em Terminal characteristics file
.SH "See Also"
.Xr "commands," commands
.Xr "disable," disable
.Xr "enable," enable
.Xr "ttys" ttys
.SH Diagnostics
.B ttystat
returns one
if the
.I port
is enabled, or zero if the
.I port
is disabled.
It returns \-2
if an error occurs.
