blob: 4d04eb1c61e918c69c3d4da2bd51eb0fcac83123 (
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
|
#print
Normally the 's' command only changes
the first instance on a line of the expression
it is looking for. Sometimes you want to change
more than one instance. If you put a 'g' after the
command, as in
s/cat/dog/g
all instances of 'cat' will be changed to 'dog'. To
print the result you must say
s/cat/dog/gp
('pg' at the end doesn't work, sorry).
Edit file 'stuff' in this directory to change every
instance of 'green' to 'red' on every line.
Then rewrite the file and type "ready".
#create Ref
red light, village red
red book, red paper, red pencil
red car, red sign, redhorn
#create stuff
green light, village green
green book, green paper, green pencil
green car, green sign, greenhorn
#user
#cmp stuff Ref
#log
#next
43.1a 10
43.2a 5
|