use tee with append

This commit is contained in:
6543 2019-09-04 18:50:14 +02:00
parent 389312ed8c
commit a02f8f2d7a

6
cp_sh
View File

@ -42,16 +42,16 @@ cat "$md5_tmp" | while read line; do
echo "$file_md5 $file_aim" >> "${md5}.sucess-log"
sed -i "/$file_md5/d" "$md5"
else
echo "Error: Hash mismatch: \"NEW:${file_md5_new} OLD:${file_md5}\" $file_aim" | tee "${md5}.error-log"
echo "Error: Hash mismatch: \"NEW:${file_md5_new} OLD:${file_md5}\" $file_aim" | tee -a "${md5}.error-log"
sed -i "/$file_md5/d" "$md5"
fi

else
echo "To Big: $file_md5 $file_orig" | tee "${md5}.error-log"
echo "To Big: $file_md5 $file_orig" | tee -a "${md5}.error-log"
fi

else
echo "Error: Not Exist: $file_orig" | tee "${md5}.error-log"
echo "Error: Not Exist: $file_orig" | tee -a "${md5}.error-log"
sed -i "/$file_md5/d" "$md5"
fi
done