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.
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: