完成基本脚本
commit
15b0f65cc1
|
|
@ -0,0 +1 @@
|
|||
testdata
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue