HP-UX Reference (11i v1 00/12) - 1 User Commands N-Z (vol 2)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/neqn.1
________________________________________________________________
___ ___
r
rexec(1) rexec(1)
EXAMPLES
Shell metacharacters that are not quoted are interpreted on the local host; quoted metacharacters are
interpreted on the remote host. Thus the command line:
remsh otherhost cat remotefile >> localfile
appends the remote file remotefile to the local file localfile, while the command line
remsh otherhost cat remotefile ">>" otherremotefile
appends remotefile to the remote file otherremotefile.
If the remote shell is /usr/bin/sh , the following command line sets up the environment for the remote
command before executing the remote command:
remsh otherhost . .profile 2>&- \; command
The 2>&- throws away error messages generated by executing .profile when stdin and stdout are not
aterminal.
The following command line runs remsh in the background on the local system, and the output of the
remote command comes to your terminal asynchronously:
remsh otherhost -n command &
The background remsh completes when the remote command does.
The following command line causes remsh to return immediately without waiting for the remote command
to complete:
remsh otherhost -n "command 1>&- 2>&- &"
(See remshd(1M) and sh(1)). If your login shell on the remote system is csh, use the following form
instead:
remsh otherhost -n "sh -c \"command 1>&- 2>&- &\""
RETURN VALUE
If remsh fails to set up the secondary socket connection, it returns 2. If it fails in some other way, it
returns 1. If it fully succeeds in setting up a connection with remshd, it returns 0 once the remote com-
mand has completed. Note that the return value of remsh bears no relation to the return value of the
remote command.
DIAGNOSTICS
Besides the errors listed below, errors can also be generated by the library functions rcmd() and
rresvport() which are used by remsh (see rcmd(3N)). Those errors are preceded by the name of the
library function that generated them. remsh can produce the following diagnostic messages:
Error! could not retrieve authentication type.
Please notify sys admin.
There are two authentication mechanisms used by remsh. One authentication mechanism is
based on Kerberos and the other is not. The type of authentication mechanism is obtained from
a system file which is updated by inetsvcs_sec (see inetsvcs_sec(1M)). If the system file
does not contain known authentication types, the above error is displayed.
rlogin: ...
Error in executing rlogin (rlogin is executed when the user does not specify any com-
mands to be executed). This is followed by the error message specifying why the execution
failed.
shell/tcp: Unknown service
The ‘‘shell’’ service specification is not present in the /etc/services file.
Can’t establish stderr
remsh
cannot establish secondary socket connection for stderr.
<system call>: ...
Error in executing system call. Appended to this error is a message specifying the cause of the
failure.
Section 1786 2 HP-UX Release 11i: December 2000
___
___