]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.sbin/watch/watch.8
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / usr.sbin / watch / watch.8
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
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.
36 If the tty observed by
37 .Nm
38 is closed, automatically reattach to the same tty.
39 If this option is not specified,
40 .Nm
41 will request a new tty if running in interactive mode or exit if running
42 without a controlling tty.
43 .It Fl f Ar snpdev
44 If this option is specified,
45 .Nm
46 will use
47 .Ar snpdev
48 as the
49 .Xr snp 4
50 device.
51 Without this option,
52 .Nm
53 will attempt to find the next available
54 .Xr snp 4
55 device.
56 .It Fl i
57 Force interactive mode.
58 Interactive mode is a default if
59 .Nm
60 is started from a tty.
61 If output is redirected to a file, interactive mode can still be requested
62 by specifying this option.
63 .It Fl n
64 Disable the ability to switch the watched tty interactively.
65 This disables
66 both change requests made with <control-X> as well as automatic prompting
67 when the current tty is closed or overflows.
68 In all cases where a prompt
69 would be displayed,
70 .Nm
71 will exit.
72 The reconnect flags are unaffected by
73 this option.
74 When this flag is used, <control-X> is passed through to the terminal.
75 .It Fl o
76 Reconnect on overflow.
77 The behavior of
78 .Nm
79 if the observed tty overflows is similar to the behavior if the observed tty
80 is closed.
81 For more info see
82 .Xr snp 4 .
83 .It Fl t
84 Print the date and time when observation of a given tty is started.
85 .It Fl W
86 Allow write access to observed tty.
87 .It Ar tty
88 Tty may be specified as a tty-style device, such as a pseudo tty device,
89 a virtual console, or a serial line, etc.
90 Names may be preceded by
91 .Pa /dev/ .
92 .El
93 .Sh OPERATION
94 While running in interactive mode, all user input is discarded except for:
95 .Pp
96 .Bl -tag -width "XXXX" -compact
97 .It Sy "<control-G>"
98 Exit
99 .Nm .
100 .It Sy "<control-W>"
101 Clear screen.
102 .It Sy "<control-X>"
103 Change attached tty, unless this feature is disabled, in which case
104 control-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
112 The
113 .Nm
114 utility first appeared in
115 .Fx 2.1 .
116 .Sh AUTHORS
117 .An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
118 .Sh BUGS
119 No terminal emulation is performed.
120 All user output is reproduced as-is.