Last active
August 29, 2015 14:09
-
-
Save alexfornuto/35b8ca4275fbf7002c59 to your computer and use it in GitHub Desktop.
addAlphaDir.sh
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
#!/bin/bash | |
echo "Please provide the full path to the directory to organize: " | |
read path | |
touch ~/.addAlphaDir | |
while read -r ~/.addAlphaDir | |
do | |
if [$line_in == $path]; then | |
echo "You've already run this script on that directory. If you do it again, you'll create nested directorys, and have a bad time. \n" | |
exit | |
else | |
echo "Cool, man. \n" | |
fi | |
done | |
pushd "$path" | |
for ch in {a..z} | |
do | |
mkdir new"$ch" | |
mv "$ch"* new"$ch" | |
mv "${ch^^}"* new"$ch" | |
mv new"$ch" "$ch" | |
echo "$path" >> ~/.addAlphaDir.log | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well Alex, you never did get back to me if this helped you or not?