aboutsummaryrefslogtreecommitdiffstats
path: root/bin/lowercase
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2013-12-31 14:19:23 +0100
committerDavid Runge <david.runge@frqrec.com>2013-12-31 14:19:23 +0100
commit931c8711d64b50c240c5cf1079480094dbde9ff1 (patch)
tree330d282d31afdf14412a60569d87e86603bcae9b /bin/lowercase
parentd9fd1d6971d8b3d71a0f1556a3b5d29ea6641ac2 (diff)
downloaddotfiles-931c8711d64b50c240c5cf1079480094dbde9ff1.tar.gz
dotfiles-931c8711d64b50c240c5cf1079480094dbde9ff1.tar.bz2
dotfiles-931c8711d64b50c240c5cf1079480094dbde9ff1.tar.xz
dotfiles-931c8711d64b50c240c5cf1079480094dbde9ff1.zip
Adding new scripts from /usr/local/bin and updating backup-profiles and autostart
Diffstat (limited to 'bin/lowercase')
-rwxr-xr-xbin/lowercase23
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/lowercase b/bin/lowercase
new file mode 100755
index 0000000..09273b0
--- /dev/null
+++ b/bin/lowercase
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# lowerext.sh
+
+while read f; do
+ if [[ "$f" = *.* ]]; then
+ # Extract the basename
+ b="${f%.*}"
+
+ # Extract the extension
+ x="${f##*.}"
+
+ # Convert the extension to lower case
+ # Note: this only works in recent versions of Bash
+ l="${x,,}"
+
+ if [[ "$x" != "$l" ]]; then
+ mv "$f" "$b.$l"
+ fi
+ else
+ continue
+ fi
+done