Created
May 23, 2019 07:42
-
-
Save long-long-float/42b2c07fc8af4a2af700bbe14c2c8d10 to your computer and use it in GitHub Desktop.
qsub実行後その出力をtail -Fするスクリプト
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/sh | |
# awesome qsub | |
job_file=$1 | |
result=`qsub $job_file` | |
reg="s/^Your job ([0-9]+) \\(\"$job_file\"\\) has been submitted$/\1/" | |
id=`echo "$result" | sed -r "$reg"` | |
echo "job #$id has been submitted!" | |
output_file=${job_file}.o$id | |
while [ ! -e $output_file ]; do | |
sleep 1 | |
done | |
echo "tail -F of output file" | |
tail -F $output_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment