Voici un petit script sous cygwin qui fait cela tout seul
in/bash
function print_usage()
{
echo "$`basename $0` nomDuRepertoire"
}
set -x
if [ $# -lt 1 ]
then
print_usage
else
rm -ivf *.old
FILES=`find . -type f \( -name '*.txt' -o -name '*.properties' -o -name '*.txt' -o -name '*.local' \)`
for FILE in $FILES
do
if [ -e $FILE ]
then
iconv -f cp1252 -t UTF-8 $FILE > "$FILE.new"
mv "$FILE" "$FILE.old"
mv "$FILE.new" "$FILE"
fi
done
fi
Aucun commentaire:
Enregistrer un commentaire