Last active
September 25, 2016 10:27
-
-
Save wincentbalin/4bdeaaec38ec8ffe26c6034892229e89 to your computer and use it in GitHub Desktop.
Remove prepended 4-digits numbers from filenames.
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/sh | |
# | |
# Denumerate all files | |
for weekday in [0-9]* | |
do | |
cd "$weekday" | |
for file in * | |
do | |
if [ "$file" == "url.txt" ] | |
then | |
echo Disregarding url.txt | |
continue | |
fi | |
echo Renaming $file... | |
old="$file" | |
new=`echo "$file" | cut -b 4-` | |
mv "$old" "$new" | |
done | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment