Created
March 11, 2016 21:27
-
-
Save UnkindPartition/716faa2fd6c47b3ee81a to your computer and use it in GitHub Desktop.
Clean up stale .sdr files from Kindle (paperwhite)
This file contains hidden or 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
#!/bin/sh | |
# Call this from your 'documents' directory | |
set -eu | |
for d in *.sdr | |
do | |
if [ -d "$d" -a ! -n "$(find . -maxdepth 1 -type f -name "${d%.sdr}*" -print -quit)" ] | |
then | |
echo "$d" | |
rm -rf "$d" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment