aboutsummaryrefslogtreecommitdiffstats
path: root/mypath/compare.sh
blob: 2643b42512b09f9022e10771823e35fe0e494ce1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

file1="file1.txt"
file2="file2.txt"

diff_output=$(diff "$file1" "$file2")

if [ -z "$diff_output" ]; then
  echo "两个文件完全一致"
else
  echo "两个文件不完全一致"
  echo "$diff_output"
fi