I'm learning to program in an environment without a GUI. During the course of my programming, I've found more and more that it would be better from an organization standpoint to move certain things from one file to another. At first, it was simple one or two line stuff that I could manually type out. Now, however, I'm trying to copy 78 lines of code, and that's just not going to work by hand. So I'm trying to use sed to do it for me. Right now, here's my code:
sed '1,78 p' file1 > file2
It works...in a sense. Except that for some weird reason, it copies the top portion 8 times, then the upper middle four times, lower middle 2 times, and the bottom part is copied correctly.
If there's a better way to copy only lines 1 through 78 from file1 to file2, I'd be interested in hearing it.