/ Published in: Bash

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/bin/bash #This script searches for .rpmnew files created by yum that are actually identical #to their base file and removes them. updatedb FILES=$(locate .rpmnew) for FILE in ${FILES} do MD1=`echo $FILE | sed 's/.rpmnew//' | xargs md5sum | awk '{print $1}'` MD2=`md5sum $FILE | awk '{print $1}'` if [ $MD1 == $MD2 ] then echo "$FILE removed as it was identical" rm $FILE fi done updatedb
Comments
