Created
May 30, 2016 20:11
-
-
Save david-pm/c13dc333ebd210bc67de59b013b82b5e to your computer and use it in GitHub Desktop.
replaces spaces with underscores in file names if rename utility is unavailable
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 | |
| # replace spaces with underscores in file names | |
| ls | while read file | |
| do | |
| mv "$file" "$(echo "$file" | sed -e 's/\ /_/g')" | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some systems dont have the rename command available