add minor cleanup scripts for naming

This commit is contained in:
Zeeshan Lakhani 2014-03-04 23:23:53 -05:00
parent c3cf0484bd
commit 90d3b015a3
97 changed files with 15 additions and 0 deletions

15
.scripts/cleanup.sh Executable file
View File

@ -0,0 +1,15 @@
#! /bin/bash
find -E . -regex '.*(pdf)$' -type f | while read f
do
p="$(basename "$f")"
dir="$(dirname "$f")"
lc=$(echo ${p} | tr '[:upper:]' '[:lower:]' \
| tr '_' '-' | tr -d ':' | tr -d ',' | tr '[:blank:]' '-' \
| sed 's/\-\-*/-/')
if [ "$p" != "$lc" ]
then
git mv -f "$dir/$p" "$dir/$lc"
fi
done