When pasting something to the terminal (especially if it's longer than one line or was copied from an untrusted source), I like this approach:
1. open your terminal emulator;
2. press Ctrl-X + Ctrl-E in a shell prompt;
3. it opens your $EDITOR, paste the command there, check it for anything unusual, then save and exit;
4. the shell runs whatever was in that script you saved.