简体   繁体   English

如何使用csh脚本登录到远程计算机并在其上执行命令?

[英]How to login into a remote machine and execute commands on it using csh script?

I am trying to execute this script. 我正在尝试执行此脚本。 Whenever i try to rsh/rlogin to the machine, it stops the the script from executing and the commands that follow stop executing, please help. 每当我尝试rsh / rlogin到计算机时,它都会停止执行脚本并停止执行其后的命令,请提供帮助。

#!/bin/csh -xvf

#####BUILDING####
rlogin buildsub 
pushd $currdir/$currdate/ABC/src;
bsub -I make 64bit=yes dev=opt

Your three commands are each executed separately on your local machine, one after another. 您的三个命令分别在本地计算机上一个接一个地执行。 Your script doesn't know that the pushd and the bsub are supposed to be used as input to the rlogin. 您的脚本不知道应该将pushed和bsub用作rlogin的输入。 To get round this, use a here doc: 要解决此问题,请使用此处文档:

rlogin buildsub  << END_BLOCK
pushd $currdir/$currdate/ABC/src;
bsub -I make 64bit=yes dev=opt
END_BLOCK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM