blob: 6ef8b47e403a4861b593d6a6f694ddcd94a97516 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#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
|