Created
July 3, 2017 15:18
-
-
Save tjkendev/2063dd330cbb1d68099a3b298d76bbcf to your computer and use it in GitHub Desktop.
竸プロのinとoutのdiffチェック
This file contains 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 | |
# ICPCの回答チェック (diffを取る) | |
# usage: sh domestic-2017.sh "python a.py" A | |
name="domestic-2017" | |
in_ext="in" | |
out_ext="diff" | |
# コードの実行コマンド: 例) "python a.py" | |
program_command=$1 | |
# 問題番号: 例) "A" | |
alphabet=$2 | |
# 入力 | |
input_files=(`find ./${name}/${alphabet}*.${in_ext}`) | |
# 出力 | |
output_files=(`find ./${name}/${alphabet}*.${out_ext}`) | |
num=${#input_files[@]} | |
for i in `seq 0 $(($num-1))`; do | |
input=${input_files[$i]} | |
output=${output_files[$i]} | |
echo "$input ==> $output" | |
$program_command < $input | colordiff -u - $output | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment