This may be a very simple question, but if I have the job ID, how would I get the state of the job submitted through SGE? I basically want to check on a job ID and see if it's in an error state, it's still running, or it's completed.
I was thinking of something like this
qstat -u '*' | grep 123456
But if the job ID is low, it may return lines other than the one that I want. And using a command like this...
qstat -j '123456'
...doesn't seem to return the job state.