#!/bin/bash for file in $(ls *.patch); do ISO=$(file "${file}" | grep ISO) if [ "${ISO}" != "" ] ; then echo "Converting ${file}" tmpfile=$(mktemp convert-XXXXX || exit 1) iconv -c --to-code=UTF-8//TRANSLIT "${file}" > "${tmpfile}" mv "${tmpfile}" "${file}" fi done