# 先記錄文件的md5bash
md5sum ip.list >ip.md5
# 記錄新的md5與以前的比較spa
#!/bin/bash md5sum ip.list > .ip.md5 diff ip.md5 .ip.md5 >/dev/null 2>&1 if [ $? -eq 0 ];then echo "文件沒有變化" else echo "文件發生變化" echo "更新md5" md5sum ip.list > ip.md5 fi