From 75ea4c8d5fb2b318d0e97dad0d0228eaba7eb07d Mon Sep 17 00:00:00 2001 From: Stuart Powers Date: Wed, 15 May 2019 11:25:27 -0400 Subject: [PATCH] Fix the bash functions to handle files with spaces --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d1f425..1624452 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,8 @@ X-Url-Delete: https://transfer.sh/hello.txt/BAYh0/hello.txt/PDw0NHPcqU ### Using curl ```bash transfer() { - curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename $1) | tee /dev/null; + curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename "$1") | tee /dev/null; + echo } alias transfer=transfer @@ -72,7 +73,8 @@ alias transfer=transfer ### Using wget ```bash transfer() { - wget -t 1 -qO - --method=PUT --body-file="$1" --header="Content-Type: $(file -b --mime-type $1)" https://transfer.sh/$(basename $1); + wget -t 1 -qO - --method=PUT --body-file="$1" --header="Content-Type: $(file -b --mime-type "$1")" https://transfer.sh/$(basename "$1"); + echo } alias transfer=transfer