Consider a script, “run.sh”, to be sent to a cluster job queue via qsub,
qsub ./run.sh
My question is how do I get the number of the process — the one that appears as ${PID} on the files *.o${PID} and *.e${PID} — within the script run.sh?
Does qsub export it? On which name?
Well, apparently qsub man page does not have, but this page says that the variable $JOB_ID is created with the PID I was asking for.