prabhat
prabhat

Reputation: 291

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.

Upvotes: 3

Views: 1516

Answers (1)

Håkon Hægland
Håkon Hægland

Reputation: 40778

You may try

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

Upvotes: 2

Related Questions