This question already has an answer here:

System is Scientific Linux 7.2 with Mate Desktop. I am trying to copy an iptables-script from website https://www.pozzo-balbi.com/help/Iptables-script to a shell, which will create a file. It is the standard

cat > file << EOF
bla, bla

It is around 13kb of data and that seems to be the problem. The file saved is on 8kb big and

E.g. when I copy & pasting into the terminal I see errors like

> ipta
> #iptables -A INPUT -i \$eth -f -j REJ

instead of correct

> iptables -A INPUT -i \$eth -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -m recent --name badguy --set -j DROP # NULL Packet
> #iptables -A INPUT -i \$eth -f -j REJECT # block fragments - normally not legitimate traffic

So 1/3 of the pasted data somehow gets lost on the way.If I copy & paste only a few lines at a time, I don't get any problems. When copy & pasting into vi or the editor of mc, I also don't have problems. I normally copy over ssh to my server and I never had any problems. Only now copying locally I came across this problem.

Any hints greatly appreciated or is this a bug?

marked as duplicate by Thomas Dickey, Gilles, Community Jun 19 '16 at 1:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Worth mentioning what terminal app you're using here within Mate. – steve Jun 18 '16 at 21:14
  • 1
    Rather than copy-pasteing the script, why not grab it directly with curl -o /path/to/script http://example.com/hosted-script.sh and go from there? – DopeGhoti Jun 18 '16 at 21:24
  • It is mate-terminal 1.12.1, but I get the same problem with gnome terminal 3.14.3. @DopeGhoti there are many work arounds. What bothers me is that something isn't working as supposed to and I have no clue why. – Pozzo-Balbi Jun 18 '16 at 21:27
  • 1
    The reason that I suggested using curl is that it removes many variables from the equation. Why the copying and pasting is not working could be any or all of: your web browser, your window manager, your desktop environment, your terminal application, your shell profile, and probably other things I have not thought of. – DopeGhoti Jun 18 '16 at 21:35
  • run cat, or even sleep 123, and paste while those are running. Any difference? – Patrick Jun 18 '16 at 23:10

Browse other questions tagged or ask your own question.