Skip to content

Instantly share code, notes, and snippets.

@alexfornuto
Last active August 29, 2015 14:09
Show Gist options
  • Save alexfornuto/35b8ca4275fbf7002c59 to your computer and use it in GitHub Desktop.
Save alexfornuto/35b8ca4275fbf7002c59 to your computer and use it in GitHub Desktop.
addAlphaDir.sh
#!/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
@Hitman666
Copy link

Well Alex, you never did get back to me if this helped you or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment