Debian Codegraph @

lower-script.sh

raw symbols SCIP
1 #!/bin/bash
2
3 if [[ $1 ]]; then
4 target=$1
5 else
6 target="./data"
7 fi
8
9 read -p "Lowercase all files in $target directory? [y/N] " confirm
10
11 if [[ `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
16 fi