From 3b3bccbb841c8f74b8917c738191ff36f999e006 Mon Sep 17 00:00:00 2001 From: jamke <47451874+jamke@users.noreply.github.com> Date: Sun, 30 May 2021 19:37:03 +0700 Subject: [PATCH] Fix multiple issues in qvm-copy-to-dom0.sh Fix multiple issues with filenames containing spaces and starting dashes. The result is not tested by me at all, please check the changes before use. --- code/productivity/qvm-copy-to-dom0.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/productivity/qvm-copy-to-dom0.sh b/code/productivity/qvm-copy-to-dom0.sh index 833ddf1..d03be4c 100644 --- a/code/productivity/qvm-copy-to-dom0.sh +++ b/code/productivity/qvm-copy-to-dom0.sh @@ -6,13 +6,13 @@ # Initial author: https://github.com/one7two99/ # command line parameters -AppVM=$1 # must be present -Source=$2 # must be present -Destination=$3 # optionally +AppVM="$1" # must be present +Source="$2" # must be present +Destination="$3" # optionally # if no Destination given on commandline use ~/QubesIncoming -if [ -z "$3" ];then mkdir -p ~/QubesIncoming && \ - Destination=~/QubesIncoming/$(basename $Source); fi +if [ -z "$Destination" ];then mkdir -p -- "~/QubesIncoming" && \ + Destination="~/QubesIncoming/$(basename "$Source")"; fi # copy file from AppVM to dom0 -qvm-run --pass-io $AppVM "cat $Source" > $Destination +qvm-run --pass-io $AppVM "cat -- \"$Source\"" > "$Destination"