Created
March 4, 2019 16:25
-
-
Save rustysys-dev/810c1ecf02db460f722b04ecdea0dec7 to your computer and use it in GitHub Desktop.
Searches your dnf history entries that changed $term
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dnf-history-search () { | |
if [ -z $1 ]; then | |
echo -e "\nSpecify search term\n" | |
return 0 | |
fi | |
HISTORY=$(sudo dnf history | awk 'NR<=2 { next } { print $1 }') | |
for item in $HISTORY | |
do | |
ITEM=$(sudo dnf history info $item | grep $1) | |
if ! [ -z "$ITEM" ]; then | |
echo -e "\n$item:\n\n$ITEM" | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment