The RSH (Remote Shell) command connects your terminal to a remote host and requests it to execute the command, script, or command procedure that you specify. If the command generates output, you see it as if it were produced locally. If you omit a remote command when you enter an RSH command line, RSH initiates an RLOGIN session. However, if the command line includes the /PASSWORD qualifier, the remote login attempt fails. Using the /PASSWORD qualifier invokes REXEC. Syntax rules require that you enter your RSH command line so that the remote command is the last word. Quotation Marks If the remote command is one or more lowercase words, you do not need to enclose them in double quotation marks on the RSH command line. However, double quotation marks ( " " ) are required for the following: o Mixed-case UNIX commands o Uppercase UNIX commands In addition, RSH handles one double quotation mark ( " ) and two consecutive double quotation marks ( " " ) in the following manner: o If you enter one double quotation mark on a command line, RSH removes it. o If you enter two consecutive double quotation marks on the command line, RSH removes the first quotation mark and leaves the second. o If you enclose text within double quotation marks on a command line, RSH disables the default conversion of characters to lowercase and removes the quotation marks. Note that, as a general rule, if you are uncertain about whether or not to use quotation marks, you should use them. Interrupting Commands To stop remote execution of a command, press either Ctrl/C or Ctrl/Y.
1 – Examples
The following examples show how to use the RSH command. 1. In the first example, the remote system manager previously created an entry in the authentication files for remote user STAN on host oster, giving STAN permission to access user rolly. From the local OpenVMS host, user STAN views rolly's directory, which resides on UNIX system oster. No quotation marks are required around the user name and host name because RSH by default sends them in lowercase. $ RSH /USER_NAME=ROLLY OSTER LS 2. On the following RSH command line, the uppercase UNIX qualifier -R is entered within quotation marks to preserve the uppercase R. This example assumes that the user's originating host and user name are in the authentication files on the remote host debts. $ RSH DEBTS LS "-R" 3. The following commands show how RSH sends quotation marks to a remote UNIX host and how quotation marks affect case. All examples assume that the user's originating host and user name are in the authentication files on the remote host. $ RSH DEBTS ECHO TEST MESSAGE test message $ RSH DEBTS ECHO "\""test\"" message" "test" message RSH DEBTS ECHO "TEST" MESSAGE TEST message $ RSH DEBTS "echo '""test"" message'" "test" message 4. Because a remote command is not specified on the RSH command line, TCP/IP Services executes RLOGIN. $ RSH MOON01 Password: <Return>(password not echoed) Last successful login for jjones: Fri Sep 25 10:58:31 2003 from nebula Last unsuccessful login for jjones: Fri Sep 25 11:59:43 2003 on ttyp5 Tru64 UNIX V5.0 (Rev. 148); Tue Apr 7 18:32:54 EST 2003 Compaq Computer Corporation Internal Use Only moon01> 5. In this example, the OpenVMS system manager of host WR2 previously created an entry in the authentication files for remote user SIMMS on host WR1. From OpenVMS host WR1, user SIMMS enters the DIRECTORY command to execute at host WR2. $ RSH WR2 DIRECTORY 6. In this example, the OpenVMS system manager of host WR2 previously created an entry in the authentication files for remote user SIMMS on host WR1, allowing user SIMMS access to the user name ROGERS. User SIMMS enters the DIRECTORY command from host WR1 to execute at host WR2 in user account ROGERS. $ RSH WR2 /USER=ROGERS DIRECTORY