Skip to content

Instantly share code, notes, and snippets.

@rmurphey
Last active November 28, 2017 13:38
Show Gist options
  • Save rmurphey/8364f4b91c1c0c4f0a92 to your computer and use it in GitHub Desktop.
Save rmurphey/8364f4b91c1c0c4f0a92 to your computer and use it in GitHub Desktop.
retab
#!/bin/sh
# retab a list of files from 2 spaces to 4 spaces
# todo: read the list of files from a file
for i in \
client/scripts/components/describe.jsx \
client/scripts/components/includes/header.jsx \
client/scripts/components/index.jsx \
client/scripts/components/layouts/default.jsx \
client/scripts/components/modules/error.jsx \
client/scripts/components/modules/file_upload.jsx \
client/scripts/components/modules/link.jsx \
client/scripts/components/modules/pictureBox.jsx \
client/scripts/components/modules/product.jsx \
client/scripts/components/modules/profile.jsx \
client/scripts/components/product.jsx
do
sed -e 's/^/~/' -e ': r' -e 's/^\( *\)~ /\1 ~/' -e 't r' -e 's/~//' "${i}" > temp.notabs && mv temp.notabs "${i}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment