summaryrefslogtreecommitdiff
path: root/usr.bin/learn/lib/editor/L50.1a
blob: 81bd91d9d7f41ace0a936ee89dabe46d0677c69b (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
#print
So far all the addresses you have used have been
either line numbers, '$', or '.' (or combinations
thereof).  The most useful addresses are none of
those, but are specifications of lines by content.
Anything you can ask the substitute command
to find in a line, you can ask the editor to find
in a file.  In particular,
 /xx/p
is a valid command with a line address 
 /xx/
and the 'p' command operator.  The address
 /xx/
means 'the next line containing an "xx"'.
So this command prints out the next line which
has an "xx" on it.  Edit the file 'text' and
print the line which has 'cat' on it.  Then
leave the editor and type "ready".
#create text
This is a short list of
things you might find
in the Sears, Roebuck
catalog.
 tools
 furniture
 electrical parts
 clothes
 appliances
 garden equipment.
#copyout
#user
#uncopyout
grep catalog\. .ocopy >/dev/null
#log
#next
50.1b 10