Commit | Line | Data |
---|---|---|
fed84c9b TL |
1 | |
2 | A useful operation is to replace a string of several blanks | |
3 | by exactly one blank. Note that you can't just write | |
4 | ||
5 | s/ */ / | |
6 | ||
7 | because the " *" willl match any number of blanks | |
8 | including zero. Thus it will always match at the beginning | |
9 | of the line, even if there is no blank there. | |
10 | The normal sequence is | |
11 | ||
12 | s/ */ / | |
13 | which will only substitute for a string | |
14 | that has at least one blank in it. | |
15 | Try that command on the line in the file "line". | |
16 | Then rewrite the file "line" and type "ready". | |
17 | #create Ref | |
18 | here is a long space. | |
19 | #create line | |
20 | here is a long space. | |
21 | #user | |
22 | #cmp line Ref | |
23 | #log | |
24 | #next | |
25 | 35.2e 5 |