Earlier quoted context omitted.
Unless the URL contains shell meta characters, such as "&"…
Modern shells have easy ways to deal with this, for example bracketed-paste-magic that ships with zsh. The URL of this comment pastes like this, ready to be passed to commands: https://news.ycombinator.com/edit\?id\=29069520
autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
to your zshrc to enable it.It doesn't seem to escape $ (e.g. in https://example.org/$PATH>), which doesn't inspire confidence…
Are there any equivalents for bash?