Created
November 9, 2013 13:12
-
-
Save n3dst4/7385269 to your computer and use it in GitHub Desktop.
This is a bash script for use in Windows (for use with Cygwin/Git Bash etc) to shrink foldernames on shitty windows. Since shitty windows's shitty FS allows you to create files with a path length greater than the maximum allowable path length (!) you can end up with an undeletable folder structure. This script recurses through and renames everyt…
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 | |
# set this to the problem folder | |
BASE=/c/Users/ndc/Dropbox/projects/delete-me | |
cd $BASE | |
for i in `find $BASE -depth` | |
do | |
DIR=`dirname $i` | |
FILE=`basename $i` | |
mv $i $DIR/${FILE:0:1}; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment