1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2024-11-27 16:10:55 +01:00
pumptools/utils/files-lowercase.sh

16 lines
317 B
Bash
Raw Permalink Normal View History

#!/bin/env bash
if [ ! "$1" ]; then
echo "Usage: $0 <directory>"
exit 1
fi
for SRC in `find $1 -depth`
do
DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'`
if [ "${SRC}" != "${DST}" ]
then
[ ! -e "${DST}" ] && mv -T "${SRC}" "${DST}" || echo "${SRC} was not renamed"
fi
done