Created
August 5, 2015 12:03
-
-
Save cmeon/69adbaedf1cb6a23b4e9 to your computer and use it in GitHub Desktop.
This file groups every file according to its filename
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/bash | |
| # This file groups every file according to its filename | |
| # Inspiration came from wanting to group different classes | |
| # and their header files in separate folders | |
| # Get filenames | |
| echo "Getting filenames" | |
| FILE_LIST=$(basename -as .h *) | |
| # Create folders based on filenames | |
| echo "Grouping files..." | |
| for FILENAME in $FILE_LIST | |
| do | |
| FOLDER=$FILENAME | |
| mkdir $FOLDER | |
| mv $FILENAME.* $FOLDER | |
| done | |
| echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment