Using HP-UX Internet Services (August 2003)
Executing Commands with remsh
Using remsh
Chapter 6 57
Using remsh
The remsh command is of the following syntax:
remsh
remote_host
[-l
remote_login_name
]
command
[\;
command
...]
If you do type any command with remsh on the command line, remsh
interprets any option in the command line as rlogin option and runs the
rlogin command.
Shell metacharacters, such as, <, |, or >>, are interpreted on the local
host, only if you enclose them in double quotes. For example, the
following command creates newfile on the host basil; without the
quotes, it would create newfile on the local host:
remsh basil cat my_message ">" newfile
IMPORTANT Do not use remsh to run an interactive command, such as vi or more.
remsh hangs with some interactive commands. To run interactive
commands, log into the remote host with rlogin.
The remsh Command Examples
The following are some remsh command examples:
• remsh basil find /project -name status.july -print
This command uses the find command to look for the file
status.july in the project directory on remote host basil.
• remsh sage cd /home/sage/mike\;echo Hi, Mike! ">" hi_mike
In this command, a user on the local system uses remsh to create a
file called hi_mike in the user Mike’s home directory on the remote
host sage.
• remsh basil -l paula mailx proj_team "<" meeting_minutes
In this command, a user uses remsh to log into user Paula’s home
directory on host basil and mail the meeting_minutes file to the
members of the proj_team mailing list.
For more information, type man 1 remsh at the HP-UX prompt.