From cac8ee04d8042894705fa054a0c26943a028ae23 Mon Sep 17 00:00:00 2001 From: Matthew Batchelder Date: Tue, 16 Feb 2021 21:42:51 -0500 Subject: [PATCH] Wrap the commands in quotes --- commands/exists.sh | 2 +- commands/ls.sh | 2 +- commands/rm.sh | 2 +- commands/sync.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/exists.sh b/commands/exists.sh index 737280c..5fc6970 100755 --- a/commands/exists.sh +++ b/commands/exists.sh @@ -14,7 +14,7 @@ the_command="aws ${S3_PROFILE} ${ENDPOINT_APPEND} s3api head-object --bucket ${S echo $the_command # Verify file existence. -sh -c $the_command +sh -c "$the_command" # XXX: we are just checking the error code, but should check the result for a 404, and raise error in other cases if [ $? == 0 ] diff --git a/commands/ls.sh b/commands/ls.sh index 624d4da..2c50afb 100755 --- a/commands/ls.sh +++ b/commands/ls.sh @@ -12,7 +12,7 @@ the_command="aws ${S3_PROFILE} ${ENDPOINT_APPEND} s3 ls s3://${S3_BUCKET}/${FILE echo $the_command # Verify file existence. -output=$(sh -c $the_command) +output=$(sh -c "$the_command") echo $output diff --git a/commands/rm.sh b/commands/rm.sh index 604dffe..6b99c9c 100755 --- a/commands/rm.sh +++ b/commands/rm.sh @@ -12,7 +12,7 @@ the_command="aws ${S3_PROFILE} ${ENDPOINT_APPEND} s3 rm s3://${S3_BUCKET}/${FILE echo $the_command # Verify file existence. -output=$(sh -c $the_command) +output=$(sh -c "$the_command") echo $output diff --git a/commands/sync.sh b/commands/sync.sh index 8942f26..bc79073 100755 --- a/commands/sync.sh +++ b/commands/sync.sh @@ -7,4 +7,4 @@ the_command="aws ${S3_PROFILE} ${ENDPOINT_APPEND} s3 sync ${SOURCE_DIR:-.} s3:// echo $the_command # Sync path. -sh -c $the_command +sh -c "$the_command"