Run a qsub command from a parent folder to all directories below with a file *.dat

耗尽温柔 提交于 2019-12-12 02:58:04

问题


I am using Redhat and a pbs queuing system to submit jobs to finite element analysis code. I typically have a folder that contains a .dat file, which is what I want to run, and a .pbs file that will submit the .dat file. To submit the .dat file I would run the command "qsub *.pbs" in the directory containing both files.

How could I submit or just run "qsub *.pbs" from outside of the directories containing the .dat files. I would typically be two directories up from the .dat files.

Thanks


回答1:


You could do a find and exec

find /tmp/foo -name "*.pbs" -exec qsub {} \;

Here is a test that I ran

[spuder@moab tmp]$ mkdir /tmp/torqueFun
[spuder@moab tmp]$ cd !$
[spuder@moab torqueFun]$ touch foo.pbs
[spuder@moab torqueFun]$ touch bar.pbs
[spuder@moab torqueFun]$ touch foobar.pbs

[spuder@moab torqueFun]$ find . -name "*.pbs" -exec qsub {} \;
19185.moab.novalocal
19186.moab.novalocal
19187.moab.novalocal


来源:https://stackoverflow.com/questions/16943022/run-a-qsub-command-from-a-parent-folder-to-all-directories-below-with-a-file-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!