fix: Quote $0 and printed variable (#263)

This commit is contained in:
Edwin Kofler
2023-12-13 06:25:04 -08:00
committed by GitHub
parent c859a821b8
commit d14cafde7b
+3 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
APPNAME=$(basename $0 | sed "s/\.sh$//") APPNAME=$(basename "$0" | sed "s/\.sh$//")
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Log functions # Log functions
@@ -32,7 +32,7 @@ trap 'fn_terminate_script' SIGINT
# Small utility functions for reducing code duplication # Small utility functions for reducing code duplication
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
fn_display_usage() { fn_display_usage() {
echo "Usage: $(basename $0) [OPTION]... <[USER@HOST:]SOURCE> <[USER@HOST:]DESTINATION> [exclude-pattern-file]" echo "Usage: $(basename "$0") [OPTION]... <[USER@HOST:]SOURCE> <[USER@HOST:]DESTINATION> [exclude-pattern-file]"
echo "" echo ""
echo "Options" echo "Options"
echo " -p, --port SSH port." echo " -p, --port SSH port."
@@ -298,7 +298,7 @@ while :; do
;; ;;
--rsync-get-flags) --rsync-get-flags)
shift shift
echo $RSYNC_FLAGS echo "$RSYNC_FLAGS"
exit exit
;; ;;
--rsync-set-flags) --rsync-set-flags)