Skip to content

Instantly share code, notes, and snippets.

@vmpartner
Forked from akost/convert.sh
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vmpartner/f8ab0bec61fd28f0910f to your computer and use it in GitHub Desktop.
Save vmpartner/f8ab0bec61fd28f0910f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Recursive file convertion utf-8 --> windows-1251
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
echo " $file"
recode UTF-8..CP1251 $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment