BSD 3 development
[unix-history] / usr / lib / learn / editor / L10.2a
#print
Often you want to refer to the last line
of a file, and you don't know how long it is.
There is a special address, "$" for this purpose.
"$" refers to the end of a file. Thus
$p
prints the last line of a file and
1,$p
prints all of a file.
Here's another file. Print all of it, and
then type the usual w, q, and ready.
Your commands should look like
1,$p
w
q
ready
#create Ref
1,$p
w
q
#create file
New York Mets Managers
Casey Stengel
Wes Westrum
Gil Hodges
Yogi Berra
Roy McMillan
#copyin
#pipe
ed file
#user
#unpipe
#uncopyin
tail -3 .copy >X1
#cmp X1 Ref
#log
#next
10.1b 10
10.2b 5