Created
September 15, 2012 11:54
-
-
Save nkuln/3727483 to your computer and use it in GitHub Desktop.
Simple batch file name replace in bash
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 | |
# Debugging .. print all commands executed | |
set -x | |
for f in * | |
do | |
# Replace all occurrences of '%20' with ' ' (single space) | |
newname=${f//%20/ } | |
# We're safer with quotes around .. | |
mv "$f" "$newname" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment