The example given has more then one mistake, here's one that will work:
\$IPTABLES -A INPUT -p tcp -i \$OUTPUT -s 0/0 to 0/0 -j ACCEPT
- Include a proper hasbang (no ! in your example),
- << instead of <<<,
- first (!) EOF needs the ; at the end,
- the first EOF needs double quotes,
- special chars need to be escaped inside your here document.
Hope this helps..