xref: /dragonfly/usr.sbin/watch/watch.8 (revision 1de703da)
1.\"
2.\" $FreeBSD: src/usr.sbin/watch/watch.8,v 1.18.2.4 2003/03/11 22:31:34 trhodes Exp $
3.\" $DragonFly: src/usr.sbin/watch/watch.8,v 1.2 2003/06/17 04:30:04 dillon Exp $
4.\"
5.Dd November 24, 2001
6.Dt WATCH 8
7.Os
8.Sh NAME
9.Nm watch
10.Nd snoop on another tty line
11.Sh SYNOPSIS
12.Nm
13.Op Fl cinotW
14.Op Fl f Ar snpdev
15.Op Ar tty
16.Sh DESCRIPTION
17The
18.Nm
19utility allows the user to examine all data coming through a specified tty
20using the
21.Xr snp 4
22device.
23If the
24.Xr snp 4
25device is not available,
26.Nm
27will attempt to load the module
28.Pq Nm snp .
29The
30.Nm
31utility writes to standard output.
32.Pp
33The options are as follows:
34.Bl -tag -width indent
35.It Fl c
36Reconnect on close.  If 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.  This disables
65both change requests made with <control-X> as well as automatic prompting
66when the current tty is closed or overflows.  In all cases where a prompt
67would be displayed,
68.Nm
69will exit.  The reconnect flags are unaffected by
70this option.
71When this flag is used, <control-X> is passed through to the terminal.
72.It Fl o
73Reconnect on overflow.
74The behavior of
75.Nm
76if the observed tty overflows is similar to the behavior if the observed tty
77is closed.
78For more info see
79.Xr snp 4 .
80.It Fl t
81Print the date and time when observation of a given tty is started.
82.It Fl W
83Allow write access to observed tty.
84.It Ar tty
85Tty may be specified as a tty-style device, such as a pseudo tty device,
86a virtual console, or a serial line, etc.
87Names may be preceded by
88.Pa /dev/ .
89.El
90.Sh OPERATION
91While running in interactive mode, all user input is discarded except for:
92.Pp
93.Bl -tag -width "XXXX" -compact
94.It Sy "<control-G>"
95Exit
96.Nm .
97.It Sy "<control-W>"
98Clear screen.
99.It Sy "<control-X>"
100Change attached tty, unless this feature is disabled, in which case
101control-X is passed to the terminal as with other control characters.
102.El
103.Sh SEE ALSO
104.Xr pty 4 ,
105.Xr sio 4 ,
106.Xr snp 4 ,
107.Xr kldload 8
108.Sh BUGS
109No terminal emulation is performed.
110All user output is reproduced as-is.
111.Sh AUTHORS
112.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
113.Sh HISTORY
114The
115.Nm
116utility first appeared in
117.Fx 2.1 .
118