I do not know the maximum number of jobs a priori. So when I keep it a variable:
#!/bin/bash
caselist=/my/caselist.txt
N=`cat $caselist | wc -l`
#BSUB -J myjob[1-$N]
...
...
(I call the above script myjob.lsf)
And submit the job as bsub < myjob.lsf, I get:
Bad job name. Job not submitted.
So is there a way I can use a variable in #BSUB -J myjob[1-$N] within myjob.lsf?
The code inside the file does not get evaluated when you pass it to
bsub. You can probably remove it from the script entirely, and instead submit it differently.(speculating a bit about the
bsuboptions; the manuals I could find online were rather bad).