File:  [CSRG BSD Unix] / 42BSD / usr.lib / learn / editor / L35.2d
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:54 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD42
BSD 4.2

#print
A useful operation is to replace a string of several blanks
by exactly one blank.  Note that you can't just write

s/ */ /

because the " *" willl match any number of blanks
including zero.  Thus it will always match at the beginning
of the line, even if there is no blank there.
The normal sequence is

s/  */ /
which will only substitute for a string
that has at least one blank in it.
Try that command on the line in the file "line".
Then rewrite the file "line" and type "ready".
#create Ref
here is a long space.
#create line
here      is a long space.
#user
#cmp line Ref
#log
#next
35.2e 5

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.