1 .\" $NetBSD: rcmd.1,v 1.18 2004/09/05 08:48:32 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
67 .Op Fl u Ar localusername
78 copies its standard input to the remote command, the standard
79 output of the remote command to its standard output, and the
80 standard error of the remote command to its standard error.
81 Interrupt, quit and terminate signals are propagated to the remote
84 normally terminates when the remote command does.
85 The options are as follows:
90 option turns on socket debugging (using
94 sockets used for communication with the remote host.
96 By default, the remote username is the same as the local username.
99 option allows the remote name to be specified.
103 option allows the local username to be specified.
104 Only the superuser is allowed to use this option.
108 option redirects input from the special device
112 section of this manual page).
115 Shell metacharacters which are not quoted are interpreted on local machine,
116 while quoted metacharacters are interpreted on the remote machine.
117 For example, the command
119 .Dl rcmd otherhost cat remotefile \*[Gt]\*[Gt] localfile
121 appends the remote file
127 .Dl rcmd otherhost cat remotefile \&"\*[Gt]\*[Gt]\&" other_remotefile
132 .Ar other_remotefile .
134 .Bl -tag -width /etc/hosts -compact
146 and is primarily derived from
148 Its purpose was to create a backend driver for
150 that would allow the users of
152 to no longer require super-user privileges.
158 in the background without redirecting its input away from the terminal,
159 it will block even if no reads are posted by the remote command.
160 If no input is desired you should redirect the input of
170 to run an interactive command (like
183 This is arguably wrong, but currently hard to fix for reasons
184 too complicated to explain here.