1.\" $NetBSD: rcmd.1,v 1.18 2004/09/05 08:48:32 wiz Exp $ 2.\" 3.\" Copyright (c) 1997 Matthew R. Green. 4.\" Copyright (c) 1983, 1990 The Regents of the University of California. 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" from: @(#)rsh.1 6.10 (Berkeley) 7/24/91 32.\" from: NetBSD: rsh.1,v 1.3 1997/01/09 20:21:14 tls Exp 33.\" 34.Dd September 5, 2004 35.Dt RCMD 1 36.Os 37.Sh NAME 38.Nm rcmd 39.Nd backend driver for 40.Xr rcmd 3 41.Sh SYNOPSIS 42.Nm 43.Op Fl l Ar username 44.Op Fl u Ar localusername 45.Ar host 46.Ar command 47.Sh DESCRIPTION 48.Nm 49executes 50.Ar command 51on 52.Ar host . 53.Pp 54.Nm 55copies its standard input to the remote command, the standard 56output of the remote command to its standard output, and the 57standard error of the remote command to its standard error. 58Interrupt, quit and terminate signals are propagated to the remote 59command; 60.Nm 61normally terminates when the remote command does. 62The options are as follows: 63.Bl -tag -width flag 64.It Fl d 65The 66.Fl d 67option turns on socket debugging (using 68.Xr setsockopt 2 ) 69on the 70.Tn TCP 71sockets used for communication with the remote host. 72.It Fl l 73By default, the remote username is the same as the local username. 74The 75.Fl l 76option allows the remote name to be specified. 77.It Fl u 78The 79.Fl u 80option allows the local username to be specified. 81Only the superuser is allowed to use this option. 82.It Fl n 83The 84.Fl n 85option redirects input from the special device 86.Pa /dev/null 87(see the 88.Sx BUGS 89section of this manual page). 90.El 91.Pp 92Shell metacharacters which are not quoted are interpreted on local machine, 93while quoted metacharacters are interpreted on the remote machine. 94For example, the command 95.Pp 96.Dl rcmd otherhost cat remotefile \*[Gt]\*[Gt] localfile 97.Pp 98appends the remote file 99.Ar remotefile 100to the local file 101.Ar localfile , 102while 103.Pp 104.Dl rcmd otherhost cat remotefile \&"\*[Gt]\*[Gt]\&" other_remotefile 105.Pp 106appends 107.Ar remotefile 108to 109.Ar other_remotefile . 110.Sh FILES 111.Bl -tag -width /etc/hosts -compact 112.It Pa /etc/hosts 113.El 114.Sh SEE ALSO 115.Xr rsh 1 , 116.Xr rcmd 3 , 117.Xr environ 7 118.Sh HISTORY 119The 120.Nm 121command appeared in 122.Nx 1.3 123and is primarily derived from 124.Xr rsh 1 . 125Its purpose was to create a backend driver for 126.Xr rcmd 3 127that would allow the users of 128.Xr rcmd 3 129to no longer require super-user privileges. 130.Sh BUGS 131If you are using 132.Xr csh 1 133and put a 134.Nm 135in the background without redirecting its input away from the terminal, 136it will block even if no reads are posted by the remote command. 137If no input is desired you should redirect the input of 138.Nm 139to 140.Pa /dev/null 141using the 142.Fl n 143option. 144.Pp 145You cannot use 146.Nm rcmd 147to run an interactive command (like 148.Xr rogue 6 149or 150.Xr vi 1 ) . 151Use 152.Xr rlogin 1 153instead. 154.Pp 155The stop signal, 156.Dv SIGSTOP , 157will stop the local 158.Nm 159process only. 160This is arguably wrong, but currently hard to fix for reasons 161too complicated to explain here. 162