Skip to content

Instantly share code, notes, and snippets.

@gonzalezreal
Created February 8, 2017 13:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gonzalezreal/8736ef16515843a40516f92cbab42702 to your computer and use it in GitHub Desktop.
Save gonzalezreal/8736ef16515843a40516f92cbab42702 to your computer and use it in GitHub Desktop.
Replace spaces by tabs in all swift files
find . -name "*.swift" | while read line; do unexpand -t 4 $line > $line.new; mv $line.new $line; done
@pascalbros
Copy link

This is not going to work with a project with "spaces" in the filename.
Try this:
find . -name "*.swift" | while read line; do unexpand -t 4 "$line" > "$line.new"; mv "$line.new" "$line"; done

Hope it helps, cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment