[gnome-commander/gcmd-1-8] Adds output of commands in some scripts, fixes handling of filenames with spaces



commit 2ce713a1056fcdcc18c45f9540627dec17101cd9
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sun Mar 4 13:15:23 2018 +0100

    Adds output of commands in some scripts, fixes handling of filenames with spaces

 gcmd-scripts/duplicate.sh |    6 ++++--
 gcmd-scripts/filelist.sh  |    5 +++--
 gcmd-scripts/tar.sh       |    2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gcmd-scripts/duplicate.sh b/gcmd-scripts/duplicate.sh
index f9b41c0..d9aab67 100755
--- a/gcmd-scripts/duplicate.sh
+++ b/gcmd-scripts/duplicate.sh
@@ -1,11 +1,13 @@
 #!/bin/sh
 #name: Duplicate
+#term: true
 
 # Written by puux <puuxmine gmail com> 2016
 # Part of gnome-commander script plug-in system
 
-for n in $@
+for n in "$@"
 do
-  cp $n "1_$n"
+  cp "$n" "1_$n"
+  echo "cp \"$n\" \"1_$n\""
 done
 
diff --git a/gcmd-scripts/filelist.sh b/gcmd-scripts/filelist.sh
index 354074a..d601105 100755
--- a/gcmd-scripts/filelist.sh
+++ b/gcmd-scripts/filelist.sh
@@ -8,8 +8,9 @@
 echo "Enter file name:"
 read list
 
-for n in $@
+for n in "$@"
 do
-  echo "$n" >> $list.txt
+  echo "$n" >> "$list"
+  echo "echo \"$n\" >> \"$list\""
 done
 
diff --git a/gcmd-scripts/tar.sh b/gcmd-scripts/tar.sh
index b8d7d4d..38d2d84 100755
--- a/gcmd-scripts/tar.sh
+++ b/gcmd-scripts/tar.sh
@@ -4,5 +4,5 @@
 # Written by puux <puuxmine gmail com> 2016
 # Part of gnome-commander script plug-in system
 
-tar -cf archive.tar.gz $@ -z
+tar -cf archive.tar.gz "$@" -z
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]