Created
June 2, 2012 03:34
-
-
Save usuyama/2856411 to your computer and use it in GitHub Desktop.
qsub and check qstat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#$ -S /bin/bash | |
#$ -cwd | |
job_id=$(qsub $@ | ruby -ane 'print $F[2]') | |
while true | |
do | |
is_exist=$(qstat | ruby -ane "print 1 if \$F.first == '$job_id'") | |
if [ -z "$is_exist" ];then | |
break | |
fi | |
sleep 60 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
8行目のエスケープが難しくて、ほんとは
if [ -z
qstat | ruby -ane "if \$F.first == '$job_id';print 1;end"
];thenみたいにしたいんだけど、うまくいかない