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