Skip to content

Instantly share code, notes, and snippets.

@jeffrydegrande
Created March 7, 2011 01:19
Show Gist options
  • Save jeffrydegrande/857941 to your computer and use it in GitHub Desktop.
Save jeffrydegrande/857941 to your computer and use it in GitHub Desktop.
#!/bin/bash
for f in `find . -name \*.rb`; do
grep '^# encoding: UTF-8' $f 2>&1 >/dev/null && continue
pf=$(basename $f)
cp $f /tmp
echo "#encoding: UTF-8" > $f
cat /tmp/$pf >> $f
rm /tmp/$pf
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment