rsh - remote shell
/usr/bsd/rsh host [ -l username ] [ -n ] command
/usr/bsd/rsh username@host [ -n ] command
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 does.
The remote username used is the same as your local username, unless you
specify a different remote name with the -l option or the username@host
format. This remote name must be equivalent (in the sense of rlogin(1C))
to the originating account; no provision is made for specifying a
password with a command.
If you omit command, instead of executing a single command, you are
logged in on the remote host using rlogin(1C). In this case, rsh
understands the additional arguments to rlogin.
Shell metacharacters that are not quoted are interpreted on local
machine, while quoted metacharacters are interpreted 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.
rlogin(1C), hosts(4), rhosts(4).
If you use csh(1), rsh does not work if your .cshrc file on the remote
host unconditionally executes interactive or output-generating commands.
Put these commands inside the following conditional block:
if ($?prompt) then
so they won't interfere with rcp, rsh, and other non-interactive,
If you put a rsh(1C) in the background without redirecting its input away
from the terminal, it blocks even if no reads are posted by the remote
command. If no input is desired, you should use the -n option, which
redirects the input of rsh to /dev/null.
You cannot run an interactive command (like vi(1)); use rlogin(1C).
Job control signals stop the local rsh process only; this is arguably
wrong, but currently hard to fix.
PPPPaaaaggggeeee 2222 [ Back ]