Sometimes you can have a very long line of input that you want to write to a file. It might come from your personal computer, a device hooked to your terminal, or just an especially long set of characters that you have to type on the keyboard. Normally the UNIX holds all characters you type until it sees a line terminator or interrupt character. Most buffers have room for 256 characters.
If you're typing the characters at the keyboard, there's an easy fix: Hit CTRL-d every 200 characters or so to flush the input buffer. You won't be able to backspace before that point, but the shell will read everything in.
cat > file
enter the very long line.........[CTRL-c] %
While you're in cbreak mode, special keys like BACKSPACE or DELETE won't be processed; they'll be stored in the file. Typing CTRL-d will not make cat quit. To quit, kill cat by pressing your normal interrupt key - say, CTRL-c.
(If you accidentally type a backspace or press RETURN when you didn't want to, you can see those characters in the file with the octal dump command, , and its -c option. Filter them out with or a text editor (the GNU editor can handle very long lines).)
One more problem: if you use a shell withand/or , they might cause you trouble because they use stty-like commands to let you edit. In that case, start a plain Bourne shell (type sh or /bin/sh) before you give the stty command.