echo $(wget $URL -O- 2>/dev/null |
sed -e 's/Shift_JIS/utf-8/g' |
sed -e 's/EUC-JP/utf-8/g' ) > $DOC_DIR"tmp.html"
nkf -w --overwrite $DOC_DIR"tmp.html"
OUT_FILE=$(echo $URL | sed 's/http:\/\///g' | sed 's/\//_/g')".html"
echo $OUT_FILE
# if File Exists, it's true
if [ -e $DOC_DIR$OUT_FILE ];
then
diff $DOC_DIR"tmp.html" $DOC_DIR$OUT_FILE > $DOC_DIR"diff.txt"
# if File is not Empty, it's true
if [ -s $DOC_DIR"diff.txt" ]; then
echo "diff file is not empty"
cp -p $DOC_DIR"tmp.html" $DOC_DIR$OUT_FILE
else
echo "do nothing"
fi
else
mv $DOC_DIR"tmp.html" $DOC_DIR$OUT_FILE
fi