sysy/scripts/crrct.sh

21 lines
531 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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