summaryrefslogtreecommitdiff
path: root/includes/generic-includes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'includes/generic-includes.sh')
-rw-r--r--includes/generic-includes.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh
index 1ed5472..3e3ef36 100644
--- a/includes/generic-includes.sh
+++ b/includes/generic-includes.sh
@@ -143,7 +143,7 @@ function copylower
# usage: copylower source destination
if [ -d "$1" ]; then
for filename in $(find "$1" -type f); do
- lowerpath="$(echo $filename|gawk -F "$1" '{print $2}'|tr A-Z a-z)"
+ lowerpath="$(echo $filename|gawk -F '$1' '{print $2}'|tr A-Z a-z)"
cp -f "$filename" "$2/$lowerpath" || die
done
elif [ -f "$1" ]; then
@@ -158,7 +158,7 @@ function setlower
if [ "$1" ]
then
cd "$1"
- for each_file in "`find ./ -iname "*"`"
+ for each_file in `find ./ -iname "*"`
do
lower="`echo "$each_file" | tr "[:upper:]" "[:lower:]"`"
@@ -174,9 +174,12 @@ function move_and_remove
{
# usage: move_and_remove source destination
# copies the files in the source directory to the destination.
- mkdir -p "$2" || die
- cp -R "$1/"* "$2" || die
- rm -r "$1"
+ if [ "$1" != "$2" ]
+ then
+ mkdir -p "$2" || die
+ cp -R "$1/"* "$2" || die
+ rm -r "$1"
+ fi
}
function teardown