1 .\" $NetBSD: rcmd.1,v 1.21 2011/05/31 11:31:10 wiz Exp $
3 .\" Copyright (c) 1997 Matthew R. Green.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" Copyright (c) 1983, 1990 The Regents of the University of California.
28 .\" All rights reserved.
30 .\" Redistribution and use in source and binary forms, with or without
31 .\" modification, are permitted provided that the following conditions
33 .\" 1. Redistributions of source code must retain the above copyright
34 .\" notice, this list of conditions and the following disclaimer.
35 .\" 2. Redistributions in binary form must reproduce the above copyright
36 .\" notice, this list of conditions and the following disclaimer in the
37 .\" documentation and/or other materials provided with the distribution.
38 .\" 3. Neither the name of the University nor the names of its contributors
39 .\" may be used to endorse or promote products derived from this software
40 .\" without specific prior written permission.
42 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
43 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 .\" from: @(#)rsh.1 6.10 (Berkeley) 7/24/91
55 .\" from: NetBSD: rsh.1,v 1.3 1997/01/09 20:21:14 tls Exp
62 .Nd backend driver for
69 .Op Fl u Ar localusername
80 copies its standard input to the remote command, the standard
81 output of the remote command to its standard output, and the
82 standard error of the remote command to its standard error.
83 Interrupt, quit and terminate signals are propagated to the remote
86 normally terminates when the remote command does.
87 The options are as follows:
90 Use IPv4 addresses only.
92 Use IPv6 addresses only.
96 option turns on socket debugging (using
100 sockets used for communication with the remote host.
102 By default, the remote username is the same as the local username.
105 option allows the remote name to be specified.
106 Another possible way to specify the remote username
112 option redirects input from the special device
116 section of this manual page).
120 instead of the one assigned to the service
122 May be given either as symbolic name or as number.
126 option allows the local username to be specified.
127 Only the superuser is allowed to use this option.
130 Shell metacharacters which are not quoted are interpreted on local machine,
131 while quoted metacharacters are interpreted on the remote machine.
132 For example, the command
134 .Dl rcmd otherhost cat remotefile \*[Gt]\*[Gt] localfile
136 appends the remote file
142 .Dl rcmd otherhost cat remotefile \&"\*[Gt]\*[Gt]\&" other_remotefile
147 .Ar other_remotefile .
149 .Bl -tag -width /etc/hosts -compact
161 and is primarily derived from
163 Its purpose was to create a backend driver for
165 that would allow the users of
167 to no longer require super-user privileges.
173 in the background without redirecting its input away from the terminal,
174 it will block even if no reads are posted by the remote command.
175 If no input is desired you should redirect the input of
185 to run an interactive command (like
198 This is arguably wrong, but currently hard to fix for reasons
199 too complicated to explain here.