#! /bin/sh if ! echo "$LC_CTYPE" | grep -Fiq utf-8; then echo "This script requires UTF-8 locale" 1>&2 exit 1 fi for fname in "$@"; do newname=$(echo "$fname" | sed -e " s/[‘“’”‘“’”″′«»\`\"]/'/g s/ *: */ - /g s/[–—]/-/g s/…/.../g s/ \+/ /g s/\?//g s/№/N/g ") newname="$(unicode_norm_nfd.py "$newname")" if [ "$fname" \!= "$newname" ]; then echo "$fname" echo "$newname" mv -- "$fname" "$newname" echo fi done