1#!/bin/bash
2
3if [[ $1 ]]; then
4	target=$1
5else
6	target="./data"
7fi
8
9read -p "Lowercase all files in $target directory? [y/N] " confirm
10
11if [[ `echo $confirm | tr '[:upper:]' '[:lower:]'` == 'y' ]]; then
12	for f in $target/*; do
13		g=`basename "$f" | tr '[:upper:]' '[:lower:]'`
14		mv -fv "$f" "$target/$g" 2> /dev/null
15	done
16fi
17