Hi,
I'm trying to teach myself vi, and I'm in Chap. 7 of Learning the Vi
Editor (5th Ed.) from O'Reilly, where it talks about the ex editor
and stuff. I tried creating the following simple ex script
====SNIP====
" This is my first ex script
" Mark lines between each KS/KE block
global /\.KS/,/\.KE/-l substitute /$/@@/
" Now join the blocks into one line
global /\.KS/,/\.KE/ join
" Sort each block--now really one line each
%!sort
" Restore the joined lines to original blocks
% substitute /@@ /^M/g
====SNIP====
I'm calling this script on a file, called glossary, which contains
some troff markup:
====SNIP====
.KS
.IP "TTY_ARGV" 2n
The command, specified as an argument vector, that the TTY subwindow
executes.
.KE
.KS
.IP "ICON_IMAGE" 2n
Sets or gets the remote image for icon's image.
.KE
.KS
.IP "XV_LABEL" 2n
Specifies a frame's header or an icon's label.
.KE
.KS
.IP "SERVER_SYNC" 2n
Synchronizes with the server once.
Does not set synchronous mode.
.KE
====SNIP====
I'm calling the script thusly:
ex - glossary newglossary
but when I look at newglossary, the error I get is:
script, 2: Illegal address: only 18 lines in the file
Can anyone tell me what's happening?
TIA!
--
David S. Jackson http://www.dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Would you buy a car with the hood welded shut?
Linux: the maintainable OS.
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.