Last active
August 29, 2015 14:21
-
-
Save astail/913a5230fc4416cd4ba9 to your computer and use it in GitHub Desktop.
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/sh | |
set -e | |
if [ $# -ne 2 ]; then | |
echo "指定された引数は$#個です。" 1>&2 | |
echo "実行するには比較するファイル名を引数1と2に入力してください。" 1>&2 | |
exit 1 | |
fi | |
md1=`md5sum $1 | awk '{ print $1 }'` | |
md2=`md5sum $2 | awk '{ print $1 }'` | |
echo "$1 と$2 を比較" | |
if [ $md1 = $md2 ]; then | |
echo 同じデータです。 | |
else | |
echo 違うデータです。 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment