Last active
October 11, 2015 03:48
-
-
Save carlosmcevilly/3797982 to your computer and use it in GitHub Desktop.
replace runs of four leading spaces with tabs in .m files
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
#!/bin/bash | |
# Bah. I prefer spaces. So why this script? I was on a project that required tabs. | |
export isconfirmed=$1 | |
if [[ ! "$isconfirmed" == 'confirmed' ]]; then | |
echo 'run with a "confirmed" command line argument to confirm you want to run this destructive operation' | |
exit -1 | |
fi | |
find . -type f -name "*.m" -print | xargs perl -pi -e "1 while s/\G {4}/\t/gc;" {} \; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment