Skip to content

Instantly share code, notes, and snippets.

@scicco
Last active December 2, 2020 22:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scicco/65544e110cc7c4dc549d0799750f6524 to your computer and use it in GitHub Desktop.
Save scicco/65544e110cc7c4dc549d0799750f6524 to your computer and use it in GitHub Desktop.
#!/bin/bash
for listfile in /var/lib/dpkg/info/*.list; do
listfilename=$(basename -- "$listfile")
listfilename="${listfilename%.*}"
echo ${listfilename}
#break
output=$(file ${listfile}| awk '{print $2}')
#echo "${output}"
if [[ $output == *"data"* ]]; then
echo "${listfile} is DATA!"
echo "mv $listfile "${listfile}.broken" || exit $?"
mv $listfile "${listfile}.broken" || exit $?
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment