Bell 32V development
[unix-history] / usr / lib / learn / editor / L35.1a
#print
The "*" character is also used in substitute commands,
but it has a different meaning. Here it means
"any number of repetitions of the previous character".
(including zero!). Thus
a*
is any number of 'a' characters, and
[ab]*
is any number of either 'a' or 'b' characters.
So
s/ab*/xy/
looks for an 'a' followed by any number of 'b'
letters, and will change
abbb cde
into
xy cde
You can use '*' after anything, including for example
blank. Thus
s/a */a/
removes all the blanks after the letter 'a'. In this
directory there is a file 'text'. On the third line,
remove the blanks after the word 'the'. Then rewrite the
file and type "ready".
#create Ref
This is the file
for experimentation
with the(substitute)
command.
#create text
This is the file
for experimentation
with the (substitute)
command.
#user
#cmp text Ref
#log
#next
36.1a 10
36.2a 5