LINUX - Make a COPY PASTE-ABLE script

MAKE A COPY PASTE OF THIS INTO CLCL
###################################

Want to make a script that you can copy paste into a shell and it makes files for you. We use EOF to mean the end but you can put anything else there at the << and at the bottom, not just EOF.

SYNTAX:
cat > file << EOF
(body goes here, make sure to escape special characters, and dont include these parenthesis)
EOF

Note so far I have only encountered $ to be special characters that need escaping but I bet !! are as well and also * and ?.

For example:
=============

Here is the normal script. This is the hpaste script from my pastebin hastebin script (use the search at top for hastebin to find it - too lazy to include the link right now)

NORMAL:
#!/bin/bash
url="http://ec2.kossboss.com:7777"
key="$(curl --silent --insecure --data-binary @/dev/fd/0  $url/documents | cut -d "\"" -f 4)"
echo $url"/"$key

Let escape all of the special characters which I think are just the $
COPY PASTE:
#!/bin/bash
url="http://ec2.kossboss.com:7777"
key="\$(curl --silent --insecure --data-binary @/dev/fd/0  \$url/documents | cut -d "\"" -f 4)"
echo \$url"/"\$key

Here it is all finished. I added chmod to make it executable after.
THE REST OF THE COPY PASTE:
cat > /usr/bin/hpaste << EOF
#!/bin/bash
url="http://ec2.kossboss.com:7777"
key="\$(curl --silent --insecure --data-binary @/dev/fd/0  \$url/documents | cut -d "\"" -f 4)"
echo \$url"/"\$key
EOF
chmod +x /usr/bin/hpaste

Afterwards see what came out and make sure it has all of the proper character.
cat /usr/bin/hpaste
#!/bin/bash
url="http://ec2.kossboss.com:7777"
key="$(curl --silent --insecure --data-binary @/dev/fd/0  $url/documents | cut -d "\"" -f 4)"
echo $url"/"$key
Comments