for entry in `find ${base}` do before="." for after in `echo "${entry}" | sed -e 's,/, ,g'` do tmp_entry="${before}/${after}" if [ "${1}" = "-l" ] ; then before=`echo "${tmp_entry}" | tr "[A-Z]" "[a-z]"` else before=`echo "${tmp_entry}" | tr "[a-z]" "[A-Z]"` fi mv -f "${tmp_entry}" "${before}" done done