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