我试图在通过ssh连接到的远程Linux服务器上运行一系列测试。Bash脚本运行顺序启动背景进程的分离循环
- 我不希望一直留在运行期间登录SSH会话- > nohup的
- 我不希望有一个是否运行做继续检查(?) - > for循环
- 因为许可问题,我只能一次运行一个测试过程(?) - >连续
- 我要继续工作,而测试组正在处理- >背景
这里是我的尝试:
#!/usr/bin/env bash
# Assembling a list of commands to be executed sequentially
TESTRUNS="";
for i in `ls ../testSet/*`;
do
MSG="running test problem ${i##*/}";
RUN="mySequentialCommand $i > results/${i##*/} 2> /dev/null;";
TESTRUNS=$TESTRUNS"echo $MSG; $RUN";
done
#run commands with nohup to be able to log out of ssh session
nohup eval $TESTRUNS &
但它看起来像nohup的不EVAL状况不佳。 有什么想法?
不要分析'ls'的输出,只需在'../ testSet/*'中替'输入',那么你不必担心它们中包含特殊字符的文件名,直到你尝试稍后执行。 。 。 –