我有以下方法使用 qsub 提交集群作业:
Submitting jobs from standard input
To submit a PBS job by typing job specifications at the command line, the user types
qsub [options] <return>
then types any directives, then any tasks, followed by
(in UNIX) CTRL-D on a line by itself
(in Windows) CTRL-Z <return>
to terminate the input.
有没有一种方法可以在 bash 脚本中对 RETURN 和 CTRL-D 进行编码,以便我们可以执行以下操作:
for i in path/*.txt; do echo "$i"; qsub [RETURN] /path2/mycode $i; [CTRL-D]; done
最佳答案
你应该通过管道使用重定向:
for i in path/*.txt; do
echo "$i";
echo "/path2/mycode $i" | qsub;
done
关于linux - 将键盘命令编码到 Bash 脚本中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/638202/