aboutsummaryrefslogtreecommitdiffstats
path: root/mypath/compare.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mypath/compare.sh')
-rwxr-xr-xmypath/compare.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/mypath/compare.sh b/mypath/compare.sh
new file mode 100755
index 0000000..2643b42
--- /dev/null
+++ b/mypath/compare.sh
@@ -0,0 +1,14 @@
1#!/bin/bash
2
3file1="file1.txt"
4file2="file2.txt"
5
6diff_output=$(diff "$file1" "$file2")
7
8if [ -z "$diff_output" ]; then
9 echo "两个文件完全一致"
10else
11 echo "两个文件不完全一致"
12 echo "$diff_output"
13fi
14