Build glue for mdocml and for mandoc as standalone tool.
[netbsd-mini2440.git] / usr.bin / rsh / rsh.1
blob0d222d264fa5f6c652f12f4b778833342e9b1a3a
1 .\"     $NetBSD: rsh.1,v 1.19 2004/09/05 08:48:32 wiz Exp $
2 .\"
3 .\" Copyright (c) 1983, 1990, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .\"     @(#)rsh.1       8.2 (Berkeley) 4/29/95
31 .\"
32 .Dd March 9, 2005
33 .Dt RSH 1
34 .Os
35 .Sh NAME
36 .Nm rsh
37 .Nd remote shell
38 .Sh SYNOPSIS
39 .Nm
40 .Op Fl 46dn
41 .Op Fl l Ar username
42 .Op Fl p Ar port
43 .Ar host
44 .Op command
45 .Nm
46 .Op Fl 46dn
47 .Op Fl p Ar port
48 .Ar username@host
49 .Op command
50 .Sh DESCRIPTION
51 .Nm
52 executes
53 .Ar command
55 .Ar host .
56 .Pp
57 .Nm
58 copies its standard input to the remote command, the standard
59 output of the remote command to its standard output, and the
60 standard error of the remote command to its standard error.
61 Interrupt, quit and terminate signals are propagated to the remote
62 command;
63 .Nm
64 normally terminates when the remote command does.
65 The options are as follows:
66 .Bl -tag -width XlXusernameX
67 .It Fl 4
68 Use IPv4 addresses only.
69 .It Fl 6
70 Use IPv6 addresses only.
71 .It Fl d
72 The
73 .Fl d
74 option turns on socket debugging (using
75 .Xr setsockopt 2 )
76 on the
77 .Tn TCP
78 sockets used for communication with the remote host.
79 .It Fl l Ar username
80 By default, the remote username is the same as the local username.
81 The
82 .Fl l
83 option or the
84 .Ar username@host
85 format allow the remote name to be specified.
86 .It Fl n
87 The
88 .Fl n
89 option redirects input from the special device
90 .Pa /dev/null
91 (see the
92 .Sx BUGS
93 section of this manual page).
94 .It Fl p Ar port
95 Uses the given
96 .Pa port
97 instead of the one assigned to the service
98 .Dq shell .
99 May be given either as symbolic name or as number.
100 If no command is given, note that
101 .Xr rlogin 1
102 is started, which may need a different daemon
103 .No ( Xr rlogind 8
104 instead of
105 .Xr rshd 8 )
106 running on the server; you want to pass the
107 .Xr rshd 8
108 port number in that case.
111 If no
112 .Ar command
113 is specified, you will be logged in on the remote host using
114 .Xr rlogin 1 .
116 Shell metacharacters which are not quoted are interpreted on local machine,
117 while quoted metacharacters are interpreted on the remote machine.
118 For example, the command
120 .Dl rsh otherhost cat remotefile \*[Gt]\*[Gt] localfile
122 appends the remote file
123 .Ar remotefile
124 to the local file
125 .Ar localfile ,
126 while
128 .Dl rsh otherhost cat remotefile \&"\*[Gt]\*[Gt]\&" other_remotefile
130 appends
131 .Ar remotefile
133 .Ar other_remotefile .
134 .\" .Pp
135 .\" Many sites specify a large number of host names as commands in the
136 .\" directory
137 .\" .Pa /usr/hosts .
138 .\" If this directory is included in your search path, you can use the
139 .\" shorthand
140 .\" .Dq host command
141 .\" for the longer form
142 .\" .Dq rsh host command .
143 .Sh FILES
144 .Bl -tag -width /etc/hosts -compact
145 .It Pa /etc/hosts
147 .Sh SEE ALSO
148 .Xr rcmd 1 ,
149 .Xr rlogin 1 ,
150 .Xr rcmd 3 ,
151 .Xr hosts.equiv 5 ,
152 .Xr rhosts 5 ,
153 .Xr environ 7
154 .Sh HISTORY
157 command appeared in
158 .Bx 4.2 .
159 .Sh BUGS
160 If you are using
161 .Xr csh 1
162 and put a
164 in the background without redirecting its input away from the terminal,
165 it will block even if no reads are posted by the remote command.
166 If no input is desired you should redirect the input of
169 .Pa /dev/null
170 using the
171 .Fl n
172 option.
174 You cannot run an interactive command (like
175 .Xr rogue 6
177 .Xr vi 1 )
178 using
179 .Nm ;
181 .Xr rlogin 1
182 instead.
184 Stop signals stop the local
186 process only; this is arguably wrong, but currently hard to fix for reasons
187 too complicated to explain here.