added depend label
[unix-history] / usr / src / usr.bin / rsh / rsh.1
CommitLineData
1fa17096
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
9b808c98 5.\" @(#)rsh.1 6.1 (Berkeley) %G%
1fa17096 6.\"
9b808c98 7.TH RSH 1C ""
1fa17096
KM
8.UC 5
9.SH NAME
10rsh \- remote shell
11.SH SYNOPSIS
12.B rsh
13host
14[
15.B \-l
16username
17] [
18.B \-n
19] command
20.br
21host
22[
23.B \-l
24username
25] [
26.B \-n
27] command
28.SH DESCRIPTION
29.I Rsh
30connects to the specified
31.I host,
32and executes the specified \fIcommand\fR.
33.I Rsh
34copies its standard input to the remote command, the standard
35output of the remote command to its standard output, and the
36standard error of the remote command to its standard error.
37Interrupt, quit and terminate signals are propagated to the remote
38command; \fIrsh\fP normally terminates when the remote command does.
39.PP
40The remote username used is the same as your local username,
41unless you specify a different remote name with the
42.B \-l
43option.
44This remote name must be equivalent (in the sense of
45.IR rlogin (1C))
46to the originating account; no provision
47is made for specifying a password with a command.
48.PP
49If you omit
50.I command,
51then instead of executing a single command, you will be logged in
52on the remote host using
53.IR rlogin (1C).
54.PP
55Shell metacharacters which are not quoted are interpreted
56on local machine, while quoted metacharacters are interpreted on
57the remote machine.
58Thus the command
59.PP
60\ \ \ rsh otherhost cat remotefile >> localfile
61.PP
62appends the remote file
63.I remotefile
64to the localfile
65.I localfile,
66while
67.PP
68\ \ \ rsh otherhost cat remotefile ">>" otherremotefile
69.PP
70appends
71.I remotefile
72to
73.I otherremotefile.
74.PP
75Host names are given in the file /etc/hosts. Each host
76has one standard name (the first name given in the file), which
77is rather long and unambiguous, and optionally one or more nicknames.
78The host names for local machines are also commands in the directory
79/usr/hosts; if you put this directory in your search path
80then the
81.B rsh
82can be omitted.
83.SH FILES
84.ta 2i
85/etc/hosts
86.br
87/usr/hosts/*
88.DT
89.SH SEE ALSO
90rlogin(1C)
91.SH BUGS
92If you are using
93.IR csh (1)
94and put a
95.IR rsh (1C)
96in the background without redirecting its input
97away from the terminal, it will block even if no reads
98are posted by the remote command. If no input is desired
99you should redirect the input of
100.I rsh
101to /dev/null using the
102.B \-n
103option.
104.PP
105You cannot run an interactive command
106(like
107.IR rogue (6)
108or
109.IR vi (1));
110use
111.IR rlogin (1C).
112.PP
113Stop signals stop the local \fIrsh\fP process only; this is arguably
114wrong, but currently hard to fix for reasons too complicated to
115explain here.