File:  [CSRG BSD Unix] / 43BSD / usr.lib / learn / editor / L8.2a
Revision 1.1: download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
CVS tags: MAIN, HEAD
Initial revision

#print
You can give addresses involving simple arithmetic
to move around in the file.  For example, 
  3+1p
is the same as
  4p
in the editor.  Now that's not interesting, but
if the current line (".") is line 3, then
  .+1p
is also 4p; it prints the next line. For example,
you can print the 3rd and 4th lines of this file
using
   3p
   .+1p
   w
   q
where "3p" prints the third line, as usual,
and then ".+1p" prints the next or fourth line.
Try that.  Type "ready" when done.
#create Ref
:caslon
:century schoolbook
:"file" 8 lines, 86 characters
#create file
baskerville
bodoni
caslon
century schoolbook
futura
helvetica
news gothic
times roman
#copyout
#pipe
ex +'set prompt noopt open' file
#user
#unpipe
#uncopyout
tail -3 .ocopy >X1
#cmp Ref X1 3
#log
#next
8.2b 5
9.1a 10

unix.superglobalmegacorp.com

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