Is there a way to execute commands on a remote host after RSHing to that host?
I've tried executing this script:
echo " "
echo " "
print "********** Remote Server *******"
echo " "
echo " "
rsh remoteserver
cd /tmp/logs
pg loga.log | grep backed
exit
but the script stops after the rsh to the remote server. When I hit the enter key, I only get the remote server command prompt. When I type "exit", I leave the remote server and the script continues executing the CD, PG, and EXIT commands on the local server.
What I want to be able to do is execute the CD and PG commands on the remote server, then EXIT from the remote server and continue with the script.
I've tried executing this script:
echo " "
echo " "
print "********** Remote Server *******"
echo " "
echo " "
rsh remoteserver
cd /tmp/logs
pg loga.log | grep backed
exit
but the script stops after the rsh to the remote server. When I hit the enter key, I only get the remote server command prompt. When I type "exit", I leave the remote server and the script continues executing the CD, PG, and EXIT commands on the local server.
What I want to be able to do is execute the CD and PG commands on the remote server, then EXIT from the remote server and continue with the script.