Last active
June 22, 2017 09:34
-
-
Save loicginoux/74785620b5aaaf88094000e58a223405 to your computer and use it in GitHub Desktop.
find all html files and change indentation from 4 spaces by 2 spaces
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
# find all html files in a directory and update indentation | |
find . -iregex '.*/.*\.html' -exec perl -pi -e 's{^((?: {4})*)}{" " x (2*length($1)/4)}e' {} \; | |
# update ndentation for one file | |
perl -pi -e 's{^((?: {4})*)}{" " x (2*length($1)/4)}e' yourfile.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment