Skip to content

Instantly share code, notes, and snippets.

@clungzta
Created August 2, 2018 07:23
Show Gist options
  • Select an option

  • Save clungzta/a670f987428302a7043e1101301e7139 to your computer and use it in GitHub Desktop.

Select an option

Save clungzta/a670f987428302a7043e1101301e7139 to your computer and use it in GitHub Desktop.
Run's a PBS job using qsub, displays output as the program runs
#!/bin/sh
# usage ./qsub_with_output.sh cnn_match.sh
# where cnn_match.sh is a qsub script
jobID=$(qsub $1)
jobIDNumeric=${jobID//[!0-9]/}
echo $jobIDNumeric
qstat -s -u am893
sleep 5
less $1'.o'$jobIDNumeric
less $1'.e'$jobIDNumeric
while qstat $jobID &>/dev/null
do
qstat -s -u am893
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment