Skip to content

Instantly share code, notes, and snippets.

@omsai
Created July 22, 2015 20:06
Show Gist options
  • Select an option

  • Save omsai/ce15450a0652bb65cf7e to your computer and use it in GitHub Desktop.

Select an option

Save omsai/ce15450a0652bb65cf7e to your computer and use it in GitHub Desktop.
Recursively replace spaces with dashes for GNU Make.
# Replace all spaces in file names with dashes.
find . -name "* *" -type f | \
while IFS= read -r f ; do \
mv "$f" "$(dirname "$f")/$(basename "$f" | tr ' ' -)" ; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment