LSF bsub add job ID to job string

169 Views Asked by At

While submitting an LSF job using bsub, I want to add the job ID to the job string.

bsub "mkdir job%J" -o %J.log

If the jobID is 3456, I was expecting to make a directory with name job3456 but instead it is job%J. The log file, specified by -o has the name job3456.log which works as expected.

1

There are 1 best solutions below

0
NullPointer On

As suggested here, use ${LSB_JOBID} and ${LSB_JOBINDEX} for array.

Also, to prevent the shell from interpreting ${} as a shell command, use the escape character \. The final solution to your problem is:

bsub "mkdir job%\${LSB_JOBID}" -o %J.log