File:  [CSRG BSD Unix] / 43BSDTahoe / usr.lib / learn / editor / L13.1a
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:58 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43tahoe
BSD 4.3tahoe

#print
Remember we said that you didn't have to know the
number of the last line, because '$' could
always be used for that.  What if you want to know
how long the file is?  Well, the editor command
  $=
will tell you what '$' is set to, i.e. the number of
lines in the file.  You can find the number of lines in
any file, then, by editing it and then typing "$=".
(You then must leave the editor with the usual wq).
How many lines are there in file 'henry'?  You may want to check
by listing the file with "cat" as well as by using "$="
in the editor.  Don't forget to leave the editor with
the usual 'wq'; eventually, type "answer N"
where N is the number of lines.
#create henry
Murray Hill
Holmdel
Whippany
Madison
Piscataway
Chester
Warren
#copyin
#user
#uncopyin
#match 7
#succeed
Of course the editor announced this fact when you first entered it.
"$=" is most useful when the number of lines changes during a session.
#log
#next
13.3a  10

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.