Start development on BSD 4_1_snap
[unix-history] / .ref-79029c32280d78322b4fb003d1cf99489dda7f1c / .ref-BSD-3 / usr / lib / learn / editor / L30.2a
#print
Changing a whole line with the 'c' command is a slow way
to work when you only want to change a few letters. The 's' (substitute)
command changes the letters within a line. For example, the command
s/abc/def/
will change a line reading
xxxabc
into one reading
xxxdef
by replacing the string 'abc' with 'def'. Try the following sequence which
alters the first line of the file 'test' within this directory:
ed test
1p
s/months/years/
1p
w
q
ready
#create Ref
Four score and seven years ago our
fathers brought forth ...
#create test
Four score and seven months ago our
fathers brought forth ...
#user
#cmp test Ref
#log
#next
30.2b 5