首先开始你想要的远程命令的样子,裸最低报价是什么:
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”' –