Skip to content

Instantly share code, notes, and snippets.

@astail
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astail/913a5230fc4416cd4ba9 to your computer and use it in GitHub Desktop.
Save astail/913a5230fc4416cd4ba9 to your computer and use it in GitHub Desktop.
#!/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