-
Notifications
You must be signed in to change notification settings - Fork 0
/
teco-manual.txt
11104 lines (8330 loc) · 487 KB
/
teco-manual.txt
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Standard TECO
TEXT EDITOR AND CORRECTOR FOR THE
VAX-11, PDP-11, PDP-10, and PDP-8
USER'S GUIDE AND LANGUAGE REFERENCE MANUAL
May 1985 Edition
TECO-11 VERSION 40
TECO-10 VERSION 3
TECO-8 VERSION 7
May, 1985
Standard TECO
The information in this document is subject to change without
notice and should not be construed as a commitment by Digital
Equipment Corporation or by DECUS.
Neither Digital Equipment Corporation, DECUS, nor the authors
assume any responsibility for the use or reliability of this
document or the described software.
Copyright (C) 1979, 1985 TECO SIG
General permission to copy or modify, but not
for profit, is hereby granted, provided that
the above copyright notice is included and
reference made to the fact that reproduction
privileges were granted by the TECO SIG.
Standard TECO PAGE i
CONTENTS
INTRODUCTION 1
PREFACE TO THE MAY 1985 EDITION 4
CHAPTER 1 BASICS OF TECO 7
1.1 USING TECO 7
1.2 DATA STRUCTURE FUNDAMENTALS 9
1.3 FILE SELECTION COMMANDS 10
1.3.1 Simplified File Selection 10
1.3.2 Input File Specification (ER command) 11
1.3.3 Output File Specification (EW command) 12
1.3.4 Closing Files (EX command) 13
1.4 INPUT AND OUTPUT COMMANDS 14
1.5 POINTER POSITIONING COMMANDS 15
1.6 TYPE OUT COMMANDS 16
1.6.1 Immediate Inspection Commands 17
1.7 TEXT MODIFICATION COMMANDS 18
1.8 SEARCH COMMANDS 19
1.9 SAMPLE EDITING JOB 20
INTERLUDE 23
CHAPTER 2 INVOKING TECO 24
2.1 RUNNING TECO 24
2.2 CREATING A NEW FILE 24
2.3 EDITING AN EXISTING FILE 24
2.4 SWITCHES ON TECO AND MAKE COMMANDS 25
2.5 INVOKING A TECO PROGRAM 26
2.6 USER INITIALIZATION 27
CHAPTER 3 CONVENTIONS AND STRUCTURES 29
3.1 TECO CHARACTER SET 29
3.2 TECO COMMAND FORMAT 30
3.2.1 Numeric Arguments 31
3.2.2 Text Arguments 32
3.2.3 Colon Modifiers 33
3.3 DATA STRUCTURES 34
3.3.1 Text Buffer 35
3.3.2 Q-registers 36
3.3.3 Q-register Push-down List 37
3.3.4 Numeric Values and Flags 37
Standard TECO PAGE ii
CHAPTER 4 COMMAND STRING EDITING 38
4.1 Immediate Action Editing Characters 38
4.2 Immediate Action Commands 41
4.3 Introduction to Macros 43
4.4 Immediate ESCAPE-Sequence Commands 44
4.5 Operating System Character Filters 46
CHAPTER 5 COMMAND DESCRIPTIONS 48
5.1 FILE SPECIFICATION COMMANDS 49
5.1.1 File Opening Commands 49
5.1.2 File Specification Switches 51
5.1.3 File Close and Exit Commands 51
5.1.4 Secondary Stream Commands 54
5.1.5 Wildcard Commands 56
5.1.6 Direct I/O to Q-Registers 56
5.2 PAGE MANIPULATION COMMANDS 58
5.3 BUFFER POINTER MANIPULATION COMMANDS 61
5.4 TEXT TYPE OUT COMMANDS 63
5.5 DELETION COMMANDS 66
5.6 INSERTION COMMANDS 68
5.7 SEARCH COMMANDS 70
5.8 SEARCH ARGUMENTS 76
5.9 Q-REGISTER MANIPULATION 80
5.10 ARITHMETIC AND EXPRESSIONS 86
5.11 SPECIAL NUMERIC VALUES 89
5.12 COMMAND LOOPS 94
5.13 BRANCHING COMMANDS 95
5.14 CONDITIONAL EXECUTION COMMANDS 101
5.15 RETRIEVING ENVIRONMENT CHARACTERISTICS 103
5.16 MODE CONTROL FLAGS 105
5.17 SCOPE COMMANDS 113
5.17.1 Video Terminal Scope Commands 113
5.17.2 Refresh Scope Commands 116
5.18 PROGRAMMING AIDS 117
5.18.1 Text Formatting 117
5.18.2 Comments 117
5.18.3 Messages 118
5.18.4 Tracing 119
5.18.5 Convenience Characters 119
5.18.6 Memory Expansion 120
5.18.7 Case Control 121
5.19 MANIPULATING LARGE PAGES 122
5.20 TECHNIQUES AND EXAMPLES 123
Standard TECO PAGE iii
APPENDIX A ASCII CHARACTER SET 128
APPENDIX B ERROR MESSAGES 137
APPENDIX C INCOMPATIBLE, OBSOLETE, AND SYSTEM-SPECIFIC
COMMANDS 145
C.1 SPECIFIC FEATURES OF TECO-11 145
C.1.1 TECO Commands 145
C.1.2 String Build Constructs 147
C.2 SPECIFIC FEATURES OF RT-11 148
C.3 SPECIFIC FEATURES OF RSTS/E 148
C.4 SPECIFIC FEATURES OF RSX-11/M, RSX-11/D,
and IAS 149
C.5 SPECIFIC FEATURES OF VAX/VMS 149
C.6 SPECIFIC FEATURES OF OS/8 149
C.7 SPECIFIC FEATURES OF TOPS-10 150
APPENDIX D RT-11 OPERATING CHARACTERISTICS 153
APPENDIX E RSTS/E OPERATING CHARACTERISTICS 157
APPENDIX F RSX-11 OPERATING CHARACTERISTICS 160
APPENDIX G VAX/VMS OPERATING CHARACTERISTICS 167
APPENDIX H OS/8 OPERATING CHARACTERISTICS 175
APPENDIX I TOPS-10 OPERATING CHARACTERISTICS 187
APPENDIX J BASIC-PLUS/BASIC-PLUS-2 HANDLING 194
GLOSSARY 197
INDEX 214
Standard TECO PAGE 1
Introduction
INTRODUCTION
TECO is a powerful text editing language available under most
DIGITAL operating systems. TECO may be used to edit any form of
ASCII text: program sources, command procedures, or manuscripts,
for example. TECO is a character-oriented editor, and also
offers a number of facilities for dealing with lines of text.
You can use TECO interactively, issuing commands which are to be
executed as soon as they are typed in. (TECO is an interpreter.)
In this mode, TECO can be used for tasks ranging from very simple
to quite complex.
You can write sequences of commands called macros, which can be
stored and then invoked by short commands or even single
keystrokes. You can write sequences of commands to be run as
TECO programs, and store them on disk for execution at
convenience.
TECO can be used as an implementation language, as it provides
powerful primitive functions for text processing, screen
handling, and keyboard management. (The VTEDIT program included
with some TECO distributions is an example of a full keypad
editor developed in the TECO language.)
TECO correctly handles most sequential ASCII formats supported by
the operating systems upon which it runs. It provides flexible
pattern-matching constructs for text searching, file wildcarding,
and special support for editing BASIC-PLUS/BASIC-PLUS-2 source
programs. A split screen scrolling feature allows command
dialogue to share the screen with an automatically-updated window
into the editing buffer.
TECO's syntax is terse; commands are designed to minimize
keystrokes. Also, the versatility of TECO "in all its glory"
makes it complex. However, just a few commands suffice to get
real work done, and a novice TECO user can begin creating and
editing text files after only a few hours of instruction. More
powerful features can be learned one at a time, and at leisure.
This manual presents TECO in two stages. The first part (Chapter
1) contains basic information and introduces that set of "just a
few" commands.
Subsequent chapters describe the full TECO command set, including
a review of the those commands presented in Chapter 1. These
chapters also introduce the concept of TECO as a programming
language and explain how basic editing commands may be combined
into "programs" sophisticated enough to handle the most
complicated editing tasks.
The early sections of this manual include few specific examples
of commands, since all TECO commands have a consistent, logical
Standard TECO PAGE 2
Introduction
format which will quickly become apparent to the beginning user.
There is, however, an extensive example at the end of Chapter 1
which employs most of the commands introduced up to that point.
Students of TECO should experiment with each command as it is
introduced, and then duplicate the examples on their computer.
(If a video terminal which supports split-screen scrolling such
as a member of the VT100 or VT200 families is available and the
TECO being used supports it, seeing both your commands and their
effects in the text buffer simultaneously can make learning
easier. A command such as "5,7:W" allows 5 lines for command
dialogue, while "watching" the text buffer on the remainder of
the screen. The 7:W command is described in Table 5-17B.)
This manual is intended to be a reference manual, and except for
Chapter 1 is not a tutorial. After Chapter 1, it is assumed that
the reader has a general familiarity with TECO and is referring
to this manual to find detailed information.
Notation
The following notation is used in this manual to represent
special characters:
Notation ASCII code (octal) Name
<NULL> 0 Null
<BS> 10 Backspace
<TAB> 11 Tab
<LF> 12 Line Feed
<VT> 13 Vertical Tab
<FF> 14 Form Feed
<CR> 15 Carriage Return
<ESCAPE> or $ 33 ESCape or Altmode
<CTRL/x> - Control-x
<space> 40 Space
<DELETE> 177 Delete or Rubout
<DELIM> or ` - See below
<DELIM> is a character used to signify the end of text strings
and TECO commands typed at the console. (TECO presumes that you
may need to deal with carriage return and line feed as ordinary
characters in ASCII text, so another character must be used as
TECO's text-string and command-string delimiter.)
When a command string is being executed, TECO looks for the
ESCape character (octal 033) as its delimiter. Some newer
terminals, however, no longer possess an ESCape key. Late-model
TECO's are capable of recognizing a surrogate (some other,
user-specified) character as signifying an ESCape when typed at
the console. Such a character echos as accent grave -- you see
Standard TECO PAGE 3
Introduction
an ` character, and TECO receives an ESCape character. (Note
that TECO programs, command files, and macros cannot use the
surrogate, since it is translated to ESCape only when you type it
at the console.) For details on choosing a surrogate for ESCape,
see the EE flag or the 8192 ET bit (section 5.16).
Throughout this manual, the term <DELIM> is used to mean whatever
character you type as a text-string or command-string delimiter.
The ` character is used throughout to mean whichever character is
echoed for a keystroke which passes an ESCape to TECO; if no
ESCape surrogate is active, you will see a $ instead.
Control characters, <CTRL/x>, are produced by striking the
CONTROL key and a character key simultaneously.
Throughout this manual, upper case characters will be used to
represent TECO commands.
Standard TECO PAGE 4
Preface to the May 1985 edition
PREFACE TO THE MAY 1985 EDITION
Trading in the ESCape key
In the beginning, terminals had ESCape keys. (Go back far
enough and the device TT: stands for might actually have
existed on the system, too.) Programs wanting to treat <CR>
& Co. as data needed another character to serve as command
delimiter, and ESCape looked available.
Times change. Welcome to ESCape sequences, to
cursor-control and function keys. Farewell to $$.
See the Introduction for the notation used in this manual.
Hello ``.
Changes to the manual
This edition of the manual incorporates new material
pertinent to the enhancements to TECO-11 between Version 36
and Version 40 (see below).
Although this manual is still not intended to be a tutorial,
some "how to learn" suggestions (such as use of split-screen
scrolling) were added, as were indications of how TECO can
be used to build custom-designed editors.
Numerous smaller changes were also made: clarifications,
new index and glossary entries, additional explanatory
material and cross referrals, correction of old typographic
errors, and (no doubt) addition of new ones.
Standard TECO PAGE 5
Preface to the May 1985 edition
From Version 36 to Version 40 - affected section numbers
Manual organization/additions --
Introduction to Macros (new section), 4.3
Split-screen scrolling, 5.17
"Immediate action commands" renamed
to "immediate inspection commands", 1,6.1
"Immediate action editing characters" (new name), 4.1
VAX/VMS filespec qualifiers, format/attribute table, G.11
Eight-bit ASCII character set table, Appendix A
Handling for BASIC-PLUS-x source files, Appendix J
"Significant" software changes --
ESCape surrogate - EE flag, 8192 ET bit, 5.16
Reverse paging (-P, et al, VAX/VMS only), 5.2
Reverse searching (-N, et al, VAX/VMS only), 5.7
Local Q-registers, 3.3.2
Local Q-register manipulation, 5.9
Immediate ESCape-sequence commands, 4.4
:^T, read/decode a keystroke, 5.11
32 ED bit controls immediate ESC-seq commands, 5.16
Acceptance and handling of 8-bit characters, [throughout]
Typeout of 8-bit data, and the 4096 ET bit, 5.16
n:^T, one-shot binary-mode character typeout, 5.4
TECO HELP facilities on VAX/VMS, G.13
"Minor" software changes --
^W as immediate mode command (screen re-paint), 4.2
<DELIM> character as immediate inspection command, 1.6.1,
4.2
Null tag allowed in computed GOTO, 5.13
Standard TECO PAGE 6
Preface to the May 1985 edition
nFRtext` command (replace n characters), 5.6
m,nFRtext` command (replace from m to n), 5.6
^E (form feed flag) can now be user-set, 5.11
Setting 1:W changes width and O/S characteristic, 5.17
WRAP/NOWRAP set by 256 ET bit on VAX/VMS, 5.16
128 ED bit inhibits auto-refresh in split scrolling, 5.16
Search matching with diacritical marks, 5.16
New 0:W codes for VT102 and GIGI scope types, 5.17
VAX/VMS handling of ^T (disabled when), 4.5
Standard TECO PAGE 7
Basics of TECO
CHAPTER 1
BASICS OF TECO
1.1 USING TECO
TECO may be called from command level by typing the appropriate
command, followed by a carriage return:
For RT-11, OS/8, TOPS-10, and TOPS-20 R TECO
For RSTS/E RUN TECO$:TECO -or-
EDIT/TECO
For RSX-11 RUN $TEC
For VAX/VMS RUN SYS$SYSTEM:TECO
TECO will respond by printing an asterisk at the left margin to
indicate that it is ready to accept user commands. At this
point, you may type one or more commands.
A TECO command consists of one or two characters which cause a
specific operation to be performed. Some TECO commands may be
preceded or followed by arguments. Arguments may be either
numeric or textual. A numeric argument is simply an integer
value which can be used to indicate, for example, the number of
times a command should be executed. A text argument is a string
of ASCII characters which might be, for example, words of text or
a file specification.
If a command requires a numeric argument, the numeric argument
always precedes the command. If a command requires a text
argument, the text argument always follows the command. Each
text argument is terminated by a special character (usually a
<DELIM> character, which TECO hears as an ESCape - see
Introduction). This indicates to TECO that the next character
typed will be the first character of a new command.
TECO accumulates commands as they are typed in a command string,
and executes commands upon receipt of two consecutive <DELIM>
characters. <DELIM> may be any character you select (if your
TECO and operating system support user-selectable ESCape
surrogates - see sections on ET and EE flags). When you type the
character you have designated as <DELIM>, TECO receives an ESCape
character, and an ` (accent grave) is echoed. (If you are not
using an ESCape surrogate -- that is, you are actually pressing
an ESCape key -- a dollar sign is echoed.) The accent grave
character is used in examples throughout this manual to represent
typed <DELIM>s. Note that the carriage return character has no
special significance to TECO; only the <DELIM><DELIM> forces
execution of the command string.
Standard TECO PAGE 8
Using TECO
TECO executes command strings from left to right until either all
commands have been executed or a command error is recognized. It
then prints an asterisk to signal that additional commands may be
entered.
If TECO encounters an erroneous command, it prints an error
message and ignores the erroneous command as well as all commands
which follow it. All error messages are of the form:
?XXX Message
where XXX is an error code and the message is a description of
the error. Some error messages mention the specific character or
string of characters in error. In these error messages, TECO
represents the non-printing special characters as follows:
Character Form Displayed
<TAB> <TAB>
<LF> <LF>
<VT> <VT>
<FF> <FF>
<CR> <CR>
<ESCAPE> <ESC>
<CTRL/x> <^x>
Every error message is followed by an asterisk at the left
margin, indicating that TECO is ready to accept additional
commands. If you type a single question mark character after a
TECO-generated error message, TECO will print the erroneous
command string up to and including the character which caused the
error message. This helps you to find errors in long command
strings and to determine how much of a command string was
executed before the error was encountered.
You can correct typing errors by hitting the DELETE key, which
may be labeled DEL or RUBOUT on your keyboard. Each depression
of the DELETE key deletes one character and echoes it on your
terminal, beginning with the last character typed. If your
terminal is a CRT, TECO will actually erase the deleted character
from the screen. You can delete an entire command string this
way, if necessary. To delete an entire line of commands, enter
the character <CTRL/U>, typed by holding down the CONTROL key
while depressing the "U" key.
When you are done editing, use the EX command to exit TECO, as
described below in section 1.3.4.
Standard TECO PAGE 9
Data Structure Fundamentals
1.2 DATA STRUCTURE FUNDAMENTALS
TECO considers any string of ASCII codes to be text. Text is
broken down into units of characters, lines, and pages. A
character is one ASCII code. A line of text is a string of ASCII
codes including one line terminator (usually a line feed) as the
last character on the line. A page of text is a string of ASCII
codes including one form feed character as the last character on
the page.
TECO maintains a text buffer in which text is stored. The buffer
usually contains one page of text, but the terminating form feed
character never appears in the buffer. TECO also maintains a
text buffer pointer. The pointer is a movable position indicator
which is never located directly on a character, but is always
between characters: between two characters in the buffer, before
the first character in the buffer, or after the last character in
the buffer.
Line feed and form feed characters are inserted automatically by
TECO. A line feed is automatically appended to every carriage
return typed to TECO and a form feed is appended to the contents
of the buffer by certain output commands. Additional line feed
and form feed characters may be entered into the buffer as text.
If a form feed character is entered into the buffer, it will
cause a page break upon output; text following the form feed
will begin a new page.
Finally, TECO maintains an input file and an output file, both of
which are selected by the user through file specification
commands. The input file may be on any device from which text
may be accepted. The output file may be on any device on which
edited text may be written.
TECO functions as a "pipeline" editor. Text is read from the
input file into the text buffer, and is written from the buffer
onto the output file. In the VAX/VMS implementation, it is
possible to "back up" as well as page forward in the file being
edited. In other implementations, once text has been written to
the output file, it cannot be accessed again without closing the
output file and reopening it as an input file.
Standard TECO PAGE 10
File Selection Commands
1.3 FILE SELECTION COMMANDS
Input and output files may be specified to TECO in several ways.
The following sections present first a simple method for
specifying files, and then more sophisticated commands that
permit flexible file selection.
NOTE
All of the following file selection commands are shown
with a general argument of "filespec". The actual
contents of this filespec argument are operating system
dependent. See the operating characteristics appendices.
Examples include a mixture of file specifications from
various operating systems.
1.3.1 Simplified File Selection
For most simple applications, you can use special operating
system commands to specify the name of the file you wish to edit
at the same time that you start up TECO.
To create a new file:
MAKE filespec
This command starts up TECO and creates the specified file for
output.
To edit an existing file:
TECO filespec
This command starts up TECO and opens the specified file for
editing while preserving the original file (as a backup file).
It also automatically brings the first page of the file into the
text buffer. These functions simulate the EB command described
in Chapter 5.
If any of the above commands do not seem to work on your
operating system, consult the appropriate appendix for
information about how to install TECO and its associated
operating system commands.
Standard TECO PAGE 11
File Selection Commands
1.3.2 Input File Specification (ER command)
TECO will accept input text from any input device in the
operating system. The input device may be specified by the text
string supplied in the ER command (and which, like any text
argument, is terminated by a <DELIM> character). The ER command
causes TECO to open the specified file or print an error message
if the file is not found. This command does not cause any
portion of the file to be read into the text buffer, however.
The following examples illustrate use of the ER command.
COMMAND FUNCTION
ERfilespec` General form of the ER command where
"filespec" is the designation of the input
file. The command is terminated by a <DELIM>
character.
ERPR:` Prepare to read an input file from the paper
tape reader.
ERPROG.MAC` Prepare to read input file PROG.MAC from the
system's default device.
ERDX1:PROG.FOR` Prepare to read input file PROG.FOR from
DX1:.
TECO will only keep one input and one output file open and
selected at a time. The current input file may be changed by
simply using the ER command to specify a new file.
It is not always necessary to specify an input file. If you want
to create a file without using any previously edited text as
input, you may type commands to insert the necessary text
directly into the text buffer from the keyboard and, at the end
of each page, write the contents of the buffer onto an output
file. Since all input is supplied from the keyboard, no input
file is necessary.
Standard TECO PAGE 12
File Selection Commands
1.3.3 Output File Specification (EW command)
TECO will write output text onto any output device in the
operating system. The output file may be specified by means of
the text string supplied in an EW command. If the output device
is a file-structured device (for example, a disk), the file name
and any extension must be supplied. If a file name is specified
but no device is explicitly specified, the system's default
device is assumed. The following examples illustrate use of the
EW command.
COMMAND FUNCTION
EWfilespec` General form of the EW command where
"filespec" is the designation of the output
file. The command is terminated by a <DELIM>
character.
EWSYS:TEXT.LST` Prepare to write output file TEXT.LST on
SYS:.
EWPROG` Prepare to write output file PROG on the
system's default device.
ERDX1:INPUT.MAC`EWOUTPUT.MAC``
Open an input file INPUT.MAC to be found on
DX1: and open an output file named
OUTPUT.MAC. The double <DELIM> (echoed as
``) terminates the command string and causes
the string to be executed. Note that the
<DELIM> which terminates the EW command may
be one of the two <DELIM>s which terminates
the command string.
You do not need to specify an output file if you only want to
examine an input file, without making permanent changes or
corrections. In this case, the contents of the input file may be
read into the text buffer page by page and examined at the
terminal. Since all output is printed on the user terminal, no
output file is needed.
Standard TECO PAGE 13
File Selection Commands
1.3.4 Closing Files (EX command)
When you are finished editing a file, use the EX command to close
out the file and exit from TECO. The current contents of the
text buffer and any portion of the input file that has not been
read yet are copied to the output file before TECO exits. The EX
command takes no arguments.
COMMAND FUNCTION
EX Write the text buffer to the current output
file, move the remainder of the current input
file to the current output file, close the
output file, then return to the operating
system.
ERFILE.MAC`EWCOPY.MAC`EX``
Open an input file FILE.MAC and open an
output file named COPY.MAC, then copy all the
text in the input file to the output file,
close the output file, and exit from TECO.
Standard TECO PAGE 14
Input and Output Commands
1.4 INPUT AND OUTPUT COMMANDS
The following commands permit pages of text to be read into the
TECO text buffer from an input file or written from the buffer
onto an output file. Once a page of text has been written onto
the output file, it cannot be recalled into the text buffer
unless the output file is closed and reopened as an input file.
COMMAND FUNCTION
Y Clear the text buffer, then read the next page of the
input file into the buffer. Since the Y command causes
the contents of the text buffer to be lost, it is not
permitted if an output file is open and there is text in
the buffer.
P Write the contents of the text buffer onto the next page
of the output file, then clear the buffer and read the
next page of the input file into the buffer.
nP Execute the P command n times. If n is not specified, a
value of 1 is assumed.
After each Y, P, or nP command, TECO positions the pointer before
the first character in the buffer.
Standard TECO PAGE 15
Pointer Positioning Commands
1.5 POINTER POSITIONING COMMANDS
The buffer pointer provides the means of specifying the location
within a block of text at which insertions, deletions or
corrections are to be made. The following commands permit the
buffer pointer to be moved to a position between any two adjacent
characters in the buffer.
COMMAND FUNCTION
J Move the pointer to the beginning of the buffer.
L Move the pointer forward to a position between the next
line feed and the first character of the next line. That
is, advance the pointer to the beginning of the next
line.
nL Execute the L command n times, where n is a signed
integer. A positive value of n moves the pointer to the
beginning of the nth line following the current pointer
position. A negative value moves the pointer backward n
lines and positions it at the beginnning of the nth line
preceding the current position. If n is zero, the
pointer is moved to the beginning of the line on which it
is currently positioned.
C Advance the pointer forward across one character.
nC Execute the C command n times, where n is a signed
integer. A positive value of n moves the pointer forward
across n characters. A negative value of n moves the
pointer backward across n characters. If n is zero, the
pointer position is not changed. Remember that there are
two characters, <CR> and <LF>, at the end of each line in
the buffer.
These commands may be used to move the buffer pointer across any
number of lines or characters in either direction; however, they
will not move the pointer across a page boundary. If a C command
attempts to move the pointer backward beyond the beginning of the
buffer or forward past the end of the buffer, an error message is
printed and the command is ignored.
If an L command attempts to exceed the page boundaries in this
manner, the pointer is positioned at the boundary which would
have been exceeded. Thus, in a page of 2000 lines, the command
"-4000L" would position the pointer before the first character in
the buffer. The command "4000L" would position the pointer after
the last character in the buffer. No error message is printed in
either case.
Standard TECO PAGE 16
Type Out Commands
1.6 TYPE OUT COMMANDS
The following commands permit sections of the text in the buffer
to be printed out on your terminal for examination. These
commands do not move the buffer pointer.
COMMAND FUNCTION
T Type the contents of the text buffer from the current
position of the pointer through and including the next
line feed character.
nT Type n lines, where n is a signed integer. A positive
value of n causes the n lines following the pointer to be
typed. A negative value of n causes the n lines
preceding the pointer to be typed. If n is zero, the
contents of the buffer from the beginning of the line on
which the pointer is located up to the pointer is typed.
This is useful for verifying the location of the buffer
pointer.
HT Type the entire contents of the text buffer.
V Type the current line. Equivalent to the sequence "0TT".
Standard TECO PAGE 17
Type Out Commands
1.6.1 Immediate Inspection Commands [not in TECO-10]
In addition, there are available as a convenience abbreviations
of two frequently used type out commands. Each one consists of a
single character, and must be the very first character typed
after TECO prints its prompting asterisk. Each of these commands
takes effect immediately; there is no need to follow any of
these commands by any <DELIM> character. For this reason, these
commands are known as "immediate" commands (see Chapter 4 for
more information on immediate commands).
COMMAND FUNCTION
<LF> Immediately execute an LT command. This command is
issued by typing the line feed key as the first keystroke
after TECO's prompt. It causes TECO to move the pointer
ahead one line and then type out the new line. On
terminals without a line feed key, typing <CTRL/J> has
the same effect. (See also the next command.)
<DELIM> Immediately execute an LT command. (Action identical to
that of the command above.) This command is available
when an ESCape surrogate is active, and causes TECO to
move the pointer ahead one line and then type out the new
line when a <DELIM> is the first thing typed after TECO's
prompting asterisk.
[RSTS/E only]
<BS> Immediately execute a -LT command. This command is
issued by typing the backspace key as the first keystroke
after TECO's prompt. It causes TECO to move the pointer
back one line and then type the line just moved over on
the terminal. On terminals without a backspace key,
typing <CTRL/H> has the same effect.
These commands are useful for "walking through" a file, examining
and/or modifying lines one at a time.
Standard TECO PAGE 18
Text Modification Commands
1.7 TEXT MODIFICATION COMMANDS
You can insert or delete text from the buffer using the following
commands:
COMMAND FUNCTION
Itext` Where "text" is a string of ASCII characters terminated
by a <DELIM> character. The specified text is inserted
into the buffer at the current position of the pointer.
The pointer is positioned immediately after the last
character of the insertion.
K Delete the contents of the text buffer from the current
position of the pointer up to and including the next line
feed character.
nK Execute the K command n times, where n is a signed
integer. A positive value of n causes the n lines
following the pointer to be deleted. A negative value of
n causes the n lines preceding the pointer to be deleted.
If n is zero, the contents of the buffer from the
beginning of the line on which the pointer is located up
to the pointer is deleted.
HK Delete the entire contents of the text buffer.
D Delete the character following the buffer pointer.
nD Execute the D command n times, where n is a signed
integer. A positive value of n causes the n characters