21 lines
531 B
Bash
21 lines
531 B
Bash
#!/bin/bash
|
||
|
||
# 定义文件夹路径
|
||
authority_folder="out1"
|
||
# authority_folder="authority"
|
||
out_folder="out2"
|
||
|
||
# 清空或创建error.txt文件
|
||
> error.txt
|
||
|
||
# 遍历authority文件夹中的所有文件
|
||
for file in "$authority_folder"/*; do
|
||
# 提取文件名
|
||
filename=$(basename "$file")
|
||
# 比较authority文件夹和out文件夹中相同名称的文件
|
||
if ! cmp -s "$file" "$out_folder/$filename"; then
|
||
# 如果文件不一致,输出文件名到error.txt
|
||
echo "$filename" >> error.txt
|
||
fi
|
||
done
|