#!/bin/bash for file ; do sed -e 's/^ *coding: *utf-8 *$/coding: utf-16le/' < "$file" \ | iconv -f utf-8 -t utf-16le > "${file/.utf-8/.strings}" done