sbatch 명령을 사용하여 23개의 개별 run_prep_chem_$dd.sh(예: run_prep_chem_08.sh...run_prep_chem_30.sh)가 포함된 스크립트를 실행하려면 어떻게 해야 합니까? 나는 이것이 for 루프에 있기 때문에 잘 작동할 것이라고 생각합니다. sbatch 위의 코드는 23번 반복되지만 at sbatch 스크립트 줄은 그렇지 않습니다.
#!/bin/bash
RP_INPUT='$RP_INPUT'
END='$END'
for dd in {08..30}; do
set dd=$dd
printf "%-3s %02d\n" "$dd" "$((10#$dd + 1))"
cat > /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/PREP_FILES/prep_chem_sources_$dd.inp << __EOF
$RP_INPUT
!---------------- grid_type of the grid output
grid_type= 'mercator',
!'rams' = rams grid
! 'polar' = polar sterog. grid output
! 'gg' = gaussian grid output
! 'll' = lat/lon grid output
! 'lambert' = lambert grid output
! 'mercator' = mercator grid output
!---------------- if the output data is for use in CATT-BRAMS model, provide at least one analysis file
$END
__EOF
cp /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/PREP_FILES/prep_chem_sources_$dd.inp /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/prep_chem_sources.inp
cat > /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/PREP_FILES/run_prep_chem_$dd.sh << BEOF
#!/bin/bash -x
#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=100000
#SBATCH --cpus-per-task=1
#SBATCH --time=00:30:00
export I_MPI_JOB_STARTUP_TIMEOUT=10000
source /etc/bashrc
module load hdf5/1.8.12
srun --distribution=block:block /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/prep_chem_sources_RADM_WRF_FIM.exe
BEOF
chmod 757 /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/PREP_FILES/run_prep_chem_$dd.sh
mv /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/PREP_FILES/run_prep_chem_$dd.sh /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/run_prep_chem_$dd.sh
sbatch --dependency=afterok:$SLURM_JOB_ID /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/run_prep_chem_$dd.sh
cp /data/users/jwsmith/PREP-CHEM-SRC-1.4/bin/AEROSE_APRIL_CTL-T-2010-04-$dd-000000-g1-ab.bin /data/users/jwsmith/WRFV3/run/AEROSE_APRIL_CTL-T-2010-04-$dd-000000-g1-ab.bin
done