2014-02-08 13:34:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ $# -eq 0 ] || [ "$1" = "-h" ] ; then
|
|
|
|
cat<<EOF
|
|
|
|
Usage: ${1##*/} FOLDERS
|
|
|
|
|
|
|
|
Rename to lowercase all files found in FOLDERS if destination does not exists.
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2014-02-09 15:02:53 +01:00
|
|
|
if ! command -v renamelower >/dev/null 2>&1; then
|
2014-02-08 13:48:03 +01:00
|
|
|
echo "'renamelower' not found in PATH. Exiting." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-02-09 15:02:53 +01:00
|
|
|
## Note: the -name check is not mandatory, but greatly improves the average
|
|
|
|
## performance.
|
2014-02-08 13:34:26 +01:00
|
|
|
for i ; do
|
2014-02-09 15:02:53 +01:00
|
|
|
find "$i" -depth -name '*[[:upper:]]*' -exec renamelower {} +
|
2014-02-08 13:34:26 +01:00
|
|
|
done
|