RSH(1C) — Unix Programmer’s Manual
NAME
rsh − remote shell
SYNOPSIS
rsh host [ −l username ] [ option ] command
host [ −l username ] [ option ] command
DESCRIPTION
Rsh connects to the specified host, and executes the specified command. Rsh copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit, and terminate signals are propagated to the remote command. Rsh normally terminates when the remote command terminates.
The remote username used is the same as your local username, unless you specify a different remote name with the −l option. This remote name must be equivalent (in the sense of rlogin(1C)) to the originating account. Rsh makes no provisions for specifying a password with a command.
If you omit command, rsh logs you in on the specified remote host using rlogin(1C). Once logged in, you can execute commands on that machine.
Rsh interprets unquoted shell metacharacters on the local machine and quoted metacharacters on the remote machine. Thus the command
rsh otherhost cat remotefile >> localfile
appends the remote file remotefile to the localfile localfile, while
rsh otherhost cat remotefile ">>" otherremotefile
appends remotefile to otherremotefile.
Hostnames are given in the file /etc/hosts. Each host has one standard name (the first name given in the file), which is rather long and unambiguous, and optionally one or more nicknames. The hostnames for local machines also serve as commands in the directory /usr/hosts. If you put this directory in your search path, you can omit the rsh command and simply type the hostname, as shown in the second line of the SYNOPSIS section.
OPTIONS
−l username Executes the remote command as the specified user.
−n Directs the input of rsh to /dev/null.
FILES
/etc/hosts
/usr/hosts/∗
SEE ALSO
BUGS
If you are using csh(1) and put a rsh(1C) in the background without redirecting its input away from the terminal, it will block even if no reads are posted by the remote command. If you do not want input from the remote command, you should redirect the input of rsh to /dev/null using the −n option.
You cannot run an interactive command (like rogue(6) or vi(1)); use rlogin(1C).
Stop signals stop the local rsh process only. This is arguably wrong, but currently hard to fix for reasons too complicated to explain here.
5 BSD — November 4, 1987