summaryrefslogtreecommitdiff
path: root/usr.bin/learn/lib/editor/L35.2d
diff options
context:
space:
mode:
authorIan Darwin <ian@cvs.openbsd.org>1998-09-28 16:01:46 +0000
committerIan Darwin <ian@cvs.openbsd.org>1998-09-28 16:01:46 +0000
commit8d70bdbdf6fd88bf88b9a384cfaafb6668c804ec (patch)
tree034fd6a68d5b6928d6fe4e51de71c9868bb460b1 /usr.bin/learn/lib/editor/L35.2d
parente9be7faad5fbf61edcad3700142615e315e407bc (diff)
import BTL learn(1) lessons/editor
Diffstat (limited to 'usr.bin/learn/lib/editor/L35.2d')
-rw-r--r--usr.bin/learn/lib/editor/L35.2d25
1 files changed, 25 insertions, 0 deletions
diff --git a/usr.bin/learn/lib/editor/L35.2d b/usr.bin/learn/lib/editor/L35.2d
new file mode 100644
index 00000000000..d92b66952c1
--- /dev/null
+++ b/usr.bin/learn/lib/editor/L35.2d
@@ -0,0 +1,25 @@
+#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