From 931c8711d64b50c240c5cf1079480094dbde9ff1 Mon Sep 17 00:00:00 2001 From: David Runge Date: Tue, 31 Dec 2013 14:19:23 +0100 Subject: Adding new scripts from /usr/local/bin and updating backup-profiles and autostart --- bin/lowercase | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/lowercase (limited to 'bin/lowercase') 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 -- cgit v1.2.3-70-g09d2