#!/bin/zsh if [[ -z "${1}" ]]; then echo "usage: ${0} DIR" >&2 exit 1 fi dir="${1}" for file in "${dir}"/*; do newfile="${file:l}" [[ "${file}" != "${newfile}" ]] && mv "${file}" "${newfile}" || echo -n done