[Chapter 25] 25.9 Adding and Deleting White Space
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-08-04T21:43:18Z

#

| Chapter 25 Showing What's in a File |

## 25.9 Adding and Deleting White Space

There are a lot of ways to change the amount of white space (space and tab characters) in a line:

- Berkeley systems have cat -s (25.10) 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 34.18.

- The crush (25.11) script removes all blank lines.

- Use doublespace and triplespace (25.12) to double- and triple-space text.

- The pushin (25.13) script replaces multiple white space characters with a single space. This can shorten long lines.

- You can use sed to indent lines of text before printing (43.9). The offset (35.7) shell script does that more easily.

- For other jobs, utilities like awk (33.11) and sed (34.24) will probably do what you want. You have to understand how to program them before you use them.

- JP

25.8 Finding File Types |  | 25.10 Squash Extra Blank Lines