summaryrefslogtreecommitdiff
path: root/usr.bin/learn/lib/editor/L13.2a
blob: a377edd25e82a6fa1f0f5902bf346250c3931432 (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
#print
Remember that "$" is the last line in
the current file.  Suppose you want to
know how long the file is, i.e. what the
number of the last line is.  The command
  $=
will tell you that.  So you can find the
length of the file "data" by saying
  ed data
  $=
  w
  q
Try that; then check by listing the file
with "cat" to see how long it is.  Then type
"ready".
#create data
This is the file
which you should
find the number
of lines in by
typing "$=" in
the editor and see
that it has exactly
nine lines in it
when printed.
#copyout
#pipe
#user
#unpipe
#uncopyout
grep 9 .ocopy >/dev/null
#log
#next
13.2b 5