Nice, thanks for the hack! It will save me a lot of time because I used to have issues with copying texts from different sources. I don’t know how I haven’t figured it out myself.
Yeah, it's a horrible way to get screwed over. It'd be easy to replace the code with a fork bomb or, more ugly, a command that deletes a bunch of files belonging to the user who ran the command. Sure, we've got backups - but how immediate and it's a pain to restore them.
So, be careful what you cut and paste.
There was a thread recently where I explained why some cut/paste terminal commands run automatically (a horrible idea) and how to prevent that. Basically, watch for whitespace at the end of what you cut and paste. If there's an extra character, the terminal may interpret it as a new line and run the command immediately after pasted!