运行 一个 sbatch 的多个文件作业
Running multiples files jobs with one sbatch
我想要 运行 N 个文件(N 个作业),它们位于我的密码中的 N 个文件夹中,例如:
Folder_1
contains file_1
Folder_2
contains file_2
|
|
|
Folder_N
contains file_N
对于一个 file_1 我只需要做 : sbatch script.sh ./folder1/file_1.
但是有没有办法为 运行N 文件创建一个循环,例如:
for i in range(N):
sbatch script.sh ./folder_i/file_i
创建一个 bash 文件:
#!/bin/bash
for i in {305..595..5} (or any range you want)
do
sbatch script.sh ./folder_$i/file_$i
done
通过这个 link 使其可执行 https://www.andrewcbancroft.com/blog/musings/make-bash-script-executable/
它运行了。
我找到了一个解决方案,我只想在这里分享它,
#!/bin/bash
ls ./folder*/file* > file (stock paths in a file)
while read p; do (read it line by line)
sbatch script.sh "$p"
done < file
我想要 运行 N 个文件(N 个作业),它们位于我的密码中的 N 个文件夹中,例如:
Folder_1
contains file_1
Folder_2
contains file_2
|
|
|
Folder_N
contains file_N
对于一个 file_1 我只需要做 : sbatch script.sh ./folder1/file_1.
但是有没有办法为 运行N 文件创建一个循环,例如:
for i in range(N):
sbatch script.sh ./folder_i/file_i
创建一个 bash 文件:
#!/bin/bash
for i in {305..595..5} (or any range you want)
do
sbatch script.sh ./folder_$i/file_$i
done
通过这个 link 使其可执行 https://www.andrewcbancroft.com/blog/musings/make-bash-script-executable/ 它运行了。
我找到了一个解决方案,我只想在这里分享它,
#!/bin/bash
ls ./folder*/file* > file (stock paths in a file)
while read p; do (read it line by line)
sbatch script.sh "$p"
done < file