Berkeley systems have 34.18.to replace sets of two or more blank lines with single blank lines. If you don't have cat -s or need something different, look at article
Thescript removes all blank lines.
Useto double- and triple-space text.
Thescript replaces multiple white space characters with a single space. This can shorten long lines.
You can use sed to. The shell script does that more easily.
For other jobs, utilities likeand will probably do what you want. You have to understand how to program them before you use them.