rsh(1C) rsh(1C) NAME rsh - remote shell SYNOPSIS /usr/bsd/rsh host [ -l username ] [-4 | -6][ -n ] command /usr/bsd/rsh username@host [-4 | -6] [ -n ] 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 does. The options are as follows: -4 Use IPv4 addresses only. -6 Use IPv6 addresses only. 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. SEE ALSO rlogin(1C), hosts(4), rhosts(4). BUGS 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 endif so they won't interfere with rcp, rsh, and other non-interactive, rcmd(3N)-based programs. 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. Page 2