更新时间:2023-01-30 20:40:38
您可以使用
for job in Job*.sh ; do sbatch --parsable $job; done | paste -s -d: | xargs -I{} sbatch --depedency afterok:{} final.sh
paste
命令将收集所有作业IDS,并将它们写在一行中,用冒号分隔,而xargs
将获取结果并将其插入到{}
占位符中.有关作业ID的信息是通过管道传递的.
The paste
command will gather all job IDS and write them on a single line, colon-separated, while xargs
will take the result and insert it at the {}
placeholder. The information about the job IDs is passed through pipes.