完成基本脚本

master
kuiki 2019-02-20 16:14:13 +08:00
commit 15b0f65cc1
2 changed files with 15 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
testdata

14
find.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
results=$(find . -name '*_1.txt')
for result in $results;do
originFile=$(echo $result | sed 's/\(.*\)_1\(\..*\)/\1\2/g')
if [ -f $originFile ];then
echo "$originFile exist!"
same=$(diff $result $originFile)
if [ ! -n "$same" ];then
echo 'file same'
rm $result
fi
fi
done