bashqsub

Capture job id of a job submitted by qsub


I have been looking for a simple way to capture the job ID of a job submitted by qsub. I saw a suggestion was given by providing a name to the job, and using that name. But that's an indirect method. I tried this way but getting an error

jobID="qsub job.sh"
35546.cell0  (This is the output I want to capture)

$jobID

qsub -W depend=afterok:$jobID analyze.sh

Can anyone please suggest a neat way to capture the job ID from qsub?

Thank you very much.


Solution

  • You may try

    qsub -W depend=afterok:$(qsub job.sh) analyze.sh