首先開始你想要的遠程命令的樣子,裸最低報價是什麼:
echo the job L_1 is finished | mutt [email protected] -s 'This is L_1.R'
只有幾個需要引用讓他們從字面上傳遞到遠程shell的事情:管道字符和主題引號,以使這些空格不會將其分解爲與mutt分開的參數。
program=("L_1" "L_2" "L_3" "L_4")
subject="The job is finished"
ssh -f c15-0330-01.ad.mtu.edu echo the job ${program[0]} is finished '|' mutt [email protected] -s "'"This is ${program[0]}.R"'";
與較長命令,做同樣的事情:
cd $address && nohup Rscript ${program[0]}.R > ${program[0]}_sh.txt && echo the job ${program[0]} is finished | mutt [email protected] -s 'This is ${program[0]}.R'
(僅與取代的變量)。
這裏,幾件事情需要被引用:
ssh -f c15-0330-01.ad.mtu.edu cd $address '&&' nohup Rscript ${program[0]}.R '>' ${program[0]}_sh.txt '&&' echo the job ${program[0]} is finished '|' mutt [email protected] -s "'"This is ${program[0]}.R"'"
你能幫我整理一下嗎'ssh -f c15- 0330-01.ad.mtu.edu'cd''$ address''&& nohup Rscript'「」$ {program [0]}「。R」'>'「」$ {program [0]}「_ sh.txt ''&&'echo'「作業$ {program [0]}已完成」'|' 'mutt「[email protected]」-s「這是''{{program [0]}'」。R「;'' –
確定,試試。 – ysth
'address =「/ home/campus27/zwang10/Desktop/AWRR/program/power/vmodel_1/nprot/K_10」' –