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