That'll get around the worst of copy/pasting long strings, but writing a more robust shell script is a better option if you're doing it for anything important.
Also, if you're copy/pasting batches of commands from the Internet, just be aware that hidden text can be snuck into command suggestions, so it's best to copy paste into a text editor first and make sure you understand what it's doing before you run it.