Error: curl: no URL specified! #52

Closed
opened 2026-01-19 18:28:46 +00:00 by michael · 1 comment
Owner

Originally created by @adrianmihalko on GitHub.

On macOS 13.3 I added shell function to .zshrc:

~/Downloads$ cat .zshrc

transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then 
file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" 
,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" 
"https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;} 

When trying to upload any file:

~/Downloads$ transfer AVRA23746510.pdf
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
transfer:3: no such file or directory: https://transfer.sh/AVRA23746510.pdf
Originally created by @adrianmihalko on GitHub. On macOS 13.3 I added shell function to .zshrc: ``` ~/Downloads$ cat .zshrc transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;} ``` When trying to upload any file: ``` ~/Downloads$ transfer AVRA23746510.pdf curl: no URL specified! curl: try 'curl --help' or 'curl --manual' for more information transfer:3: no such file or directory: https://transfer.sh/AVRA23746510.pdf ```
Author
Owner

@paolafrancesca commented on GitHub:

@adrianmihalko
the entry in .zshrc should be a single line, you can copy it directly from https://github.com/dutchcoders/transfer.sh#add-this-to-bashrc-or-zshrc-or-its-equivalent

using the code you pasted, that spans multiple lines, I can reproduce your issue, but now with the single-line version

there's probably some problem in quoting or escaping in your version that I didn't debug

@paolafrancesca commented on GitHub: @adrianmihalko the entry in `.zshrc` should be a single line, you can copy it directly from https://github.com/dutchcoders/transfer.sh#add-this-to-bashrc-or-zshrc-or-its-equivalent using the code you pasted, that spans multiple lines, I can reproduce your issue, but now with the single-line version there's probably some problem in quoting or escaping in your version that I didn't debug
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#52