-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrename2lower.sh
More file actions
executable file
·29 lines (26 loc) · 1.05 KB
/
rename2lower.sh
File metadata and controls
executable file
·29 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# Renames all files in the current directory to lower case.
# Our coding style forces to name all files lowercase to avoid spelling mistakes,
# that Windows developer don't even notice, because Windows file systems are not
# case sensitive. With this rule Windows devs wont break builds anymore. At least
# not that way ;-)
# get files with upper case letters
FILELIST=`ls | grep "[ABCDEFGHIJKLMNOPQRSTUVWXYZ]"`
if [ -z $FILELIST ]; then
echo "No files with upper case letters found in this directory that could be renamed."
exit 0
fi
if [ "$1" != "--notest" ]; then
echo "Following files would be renamed:"
for file in $FILELIST; do
FILE=`echo $file | sed -e'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
echo $file "->" $FILE
done
echo "Run ./rename2lower.sh --notest to really rename the subversion files."
else
for file in $FILELIST; do
FILE=`echo $file | sed -e'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
echo $file "->" $FILE
svn rename $file $FILE
done
fi