Merge branch 'vendor/GREP'
[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 .\" $DragonFly: src/usr.sbin/watch/watch.8,v 1.3 2006/02/17 19:40:29 swildner 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
17 The
18 .Nm
19 utility allows the user to examine all data coming through a specified tty
20 using the
21 .Xr snp 4
22 device.
23 If the
24 .Xr snp 4
25 device is not available,
26 .Nm
27 will attempt to load the module
28 .Pq Nm snp .
29 The
30 .Nm
31 utility writes to standard output.
32 .Pp
33 The options are as follows:
34 .Bl -tag -width indent
35 .It Fl c
36 Reconnect on close.  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.  This disables
65 both change requests made with <control-X> as well as automatic prompting
66 when the current tty is closed or overflows.  In all cases where a prompt
67 would be displayed,
68 .Nm
69 will exit.  The reconnect flags are unaffected by
70 this option.
71 When this flag is used, <control-X> is passed through to the terminal.
72 .It Fl o
73 Reconnect on overflow.
74 The behavior of
75 .Nm
76 if the observed tty overflows is similar to the behavior if the observed tty
77 is closed.
78 For more info see
79 .Xr snp 4 .
80 .It Fl t
81 Print the date and time when observation of a given tty is started.
82 .It Fl W
83 Allow write access to observed tty.
84 .It Ar tty
85 Tty may be specified as a tty-style device, such as a pseudo tty device,
86 a virtual console, or a serial line, etc.
87 Names may be preceded by
88 .Pa /dev/ .
89 .El
90 .Sh OPERATION
91 While running in interactive mode, all user input is discarded except for:
92 .Pp
93 .Bl -tag -width "XXXX" -compact
94 .It Sy "<control-G>"
95 Exit
96 .Nm .
97 .It Sy "<control-W>"
98 Clear screen.
99 .It Sy "<control-X>"
100 Change attached tty, unless this feature is disabled, in which case
101 control-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 HISTORY
109 The
110 .Nm
111 utility first appeared in
112 .Fx 2.1 .
113 .Sh AUTHORS
114 .An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
115 .Sh BUGS
116 No terminal emulation is performed.
117 All user output is reproduced as-is.