mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 16:01:28 +00:00
~继续拆分脚本
This commit is contained in:
10
scripts/libs/compare.sh
Normal file
10
scripts/libs/compare.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
compare() { #对比文件
|
||||
if [ ! -f "$1" ] || [ ! -f "$2" ]; then
|
||||
return 1
|
||||
elif ckcmd cmp; then
|
||||
cmp -s "$1" "$2"
|
||||
return $?
|
||||
else
|
||||
[ "$(cat "$1")" = "$(cat "$2")" ] && return 0 || return 1
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user