file named hello.c with the following contents: int main(int argc, char **argv) { printf("Hello world!\n"); return 0; } one could use the following TECO session (noting that the prompt is "*" and "$" is how ESC is echoed) to change "Hello" into "Goodbye": *EBhello.c$$ Open file for read/write with backup *P$$ Read in the first page *SHello$0TT$$ Search for "Hello" and print the line (pointer placed after searched string) printf("Hello world!\n"); The line *-5DIGoodbye$0TT$$ Delete five characters before pointer (ie "Hello"), insert "Goodbye", and print the line printf("Goodbye world!\n"); The updated line *EX$$ Copy the remainder of the file and exit These two example programs are a simple interchange sort of the current text buffer, based on the 1st character of each line, taken from the PDP-11 TECO User's Guide. A "goto" and "structured" version are shown. Example 1 !START! j 0aua ! jump to beginning, load 1st char in register A ! !CONT! l 0aub ! load first char of next line in register B ! qa-qb"g xa k -l ga 1uz ' ! if A>B, switch lines and set flag in register Z ! qbua ! load B into A ! l z-."g -l @o/CONT/ ' ! loop back if another line in buffer ! qz"g 0uz @o/START/ ' ! repeat if a switch was made on last pass ! Example 2 0uz ! clear repeat flag ! <j 0aua l ! load 1st char into register A ! <0aub ! load 1st char of next line into B ! qa-qb"g xa k -l ga -1uz ' ! if A>B, switch lines and set flag ! qbua ! load B into A ! l .-z;> ! loop back if another line in buffer ! qz;> ! repeat if a switch was made last pass ! Notes References External links Dan Murphy's personal site Pete Siemsen's TECO collection Tom Almy's TECO page. Includes a TECO based on Pete Siemsen's TECOC and DECUS documentation. There are MS-DOS, Windows (console), Linux, Mac OS X, and OS/2 versions. Introduction to the TECO syntax TECO Information TECO Manual (OS/8) History of software Massachusetts Institute of Technology software OpenVMS text editors Line editor Text-oriented programming languages