nsbin/old/rename-upper-to-lower-recursively.sh
Nico Schottelius 1ea04937d8 import an old rename script
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2010-01-02 13:27:35 +01:00

14 lines
296 B
Bash
Executable file

#!/bin/sh
# Usage:
# cd /home/user/nico/Maildir/ethz/INBOX && find . -type d -exec ~/rename.sh {} \;
old="$1"
new="$(echo $old | tr '[A-Z]' '[a-z]')"
if [ "$new" != "$old" ]; then
if [ ! -e "$old" ]; then
echo "Skipping already renamed $old"
else
mv -v "$old" "$new"
fi
fi