1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2024-11-30 17:24:30 +01:00
pumptools/utils/files-lowercase.sh

16 lines
317 B
Bash
Executable File

#!/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