Skip to content

Instantly share code, notes, and snippets.

@long-long-float
Created May 23, 2019 07:42
Show Gist options
  • Save long-long-float/42b2c07fc8af4a2af700bbe14c2c8d10 to your computer and use it in GitHub Desktop.
Save long-long-float/42b2c07fc8af4a2af700bbe14c2c8d10 to your computer and use it in GitHub Desktop.
qsub実行後その出力をtail -Fするスクリプト
#!/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