Fix the bash functions to handle files with spaces

This commit is contained in:
Stuart Powers 2019-05-15 11:25:27 -04:00
parent d16dc4298f
commit 75ea4c8d5f

View file

@ -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