xref: /freebsd/usr.sbin/watch/watch.8 (revision cc426dd31990b8b50b210efc450e404596548ca1)
1.\"
2.\" $FreeBSD$
3.\"
4.Dd November 24, 2001
5.Dt WATCH 8
6.Os
7.Sh NAME
8.Nm watch
9.Nd snoop on another tty line
10.Sh SYNOPSIS
11.Nm
12.Op Fl cinotW
13.Op Fl f Ar snpdev
14.Op Ar tty
15.Sh DESCRIPTION
16The
17.Nm
18utility allows the user to examine all data coming through a specified tty
19using the
20.Xr snp 4
21device.
22If the
23.Xr snp 4
24device is not available,
25.Nm
26will attempt to load the module
27.Pq Nm snp .
28The
29.Nm
30utility writes to standard output.
31.Pp
32The options are as follows:
33.Bl -tag -width indent
34.It Fl c
35Reconnect on close.
36If the tty observed by
37.Nm
38is closed, automatically reattach to the same tty.
39If this option is not specified,
40.Nm
41will request a new tty if running in interactive mode or exit if running
42without a controlling tty.
43.It Fl f Ar snpdev
44If this option is specified,
45.Nm
46will use
47.Ar snpdev
48as the
49.Xr snp 4
50device.
51Without this option,
52.Nm
53will attempt to find the next available
54.Xr snp 4
55device.
56.It Fl i
57Force interactive mode.
58Interactive mode is a default if
59.Nm
60is started from a tty.
61If output is redirected to a file, interactive mode can still be requested
62by specifying this option.
63.It Fl n
64Disable the ability to switch the watched tty interactively.
65This disables
66both change requests made with <control-X> as well as automatic prompting
67when the current tty is closed or overflows.
68In all cases where a prompt
69would be displayed,
70.Nm
71will exit.
72The reconnect flags are unaffected by
73this option.
74When this flag is used, <control-X> is passed through to the terminal.
75.It Fl o
76Reconnect on overflow.
77The behavior of
78.Nm
79if the observed tty overflows is similar to the behavior if the observed tty
80is closed.
81For more info see
82.Xr snp 4 .
83.It Fl t
84Print the date and time when observation of a given tty is started.
85.It Fl W
86Allow write access to observed tty.
87.It Ar tty
88Tty may be specified as a tty-style device, such as a pseudo tty device,
89a virtual console, or a serial line, etc.
90Names may be preceded by
91.Pa /dev/ .
92.El
93.Sh OPERATION
94While running in interactive mode, all user input is discarded except for:
95.Pp
96.Bl -tag -width "XXXX" -compact
97.It Sy "<control-G>"
98Exit
99.Nm .
100.It Sy "<control-W>"
101Clear screen.
102.It Sy "<control-X>"
103Change attached tty, unless this feature is disabled, in which case
104control-X is passed to the terminal as with other control characters.
105.El
106.Sh SEE ALSO
107.Xr pty 4 ,
108.Xr sio 4 ,
109.Xr snp 4 ,
110.Xr kldload 8
111.Sh HISTORY
112The
113.Nm
114utility first appeared in
115.Fx 2.1 .
116.Sh AUTHORS
117.An Ugen J.S. Antsilevich Aq Mt ugen@NetVision.net.il
118.Sh BUGS
119No terminal emulation is performed.
120All user output is reproduced as-is.
121