GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
TECO(1) FreeBSD General Commands Manual (con) TECO(1)

teco
The grand old text editor

tecoc make [-noini] [-nomemory] file
tecoc teco [-inspect] [-nocreate] [-noini] [-nomemory] [-nopage] [-norename] [+nnn] file
tecoc mung [-noini] file

This description section is sufficiently long that it has been split into a number of subsections.

teco is actually invoked by the command tecoc. It takes a first argument of make, teco, or mung to control its operating mode. In the FreeBSD version, the base name of the invoking command is tested to provide this first argument. For ease of use, it is recommended that aliases are set up. The recommended (and usual) mappings are:
Make
to tecoc make (note the uppercase first letter to avoid confusion with make(1))
teco
to tecoc teco
mung
to tecoc mung
inspect
to tecoc teco -inspect

These mappings are assumed in the Options and Command invocations sections below.

Options may be abbreviated; for each option, the part shown in brackets can be omitted. The following options are available for the teco command:
read the file only, don't create an output file.
if the file doesn't exist, don't create it.
don't execute the initialisation file. This is valid for Make or mung as well.
don't remember the filename (see Filename memory below). This is valid for Make also.
don't separate input into pages. Instead, treat form feeds as normal characters.
don't rename files, but copy them to keep references correct
+nnn
where nnn is any number of digits. Go to line number nnn and set -nopage.

There are a number of different ways of starting teco.
Make file
starts teco to create file.
This is equivalent to EWfile$$
teco file
starts teco to edit file.
This is equivalent to EBfile$Y$$
teco file2=file1
starts teco to edit file1, writing to file2.
This is equivalent to ERfile1$EWfile2$Y$$
teco
starts teco to edit the last edited file. By default, the name of that file is saved in a file named tecoN.tmp in the current directory, where N is the process ID of the parent process to teco. This can be overridden, as described in Filename memory below.
mung file args
starts teco to execute file.
This is equivalent to I<args>$JEIfile$$
Instead of mung, the command teco @file args can be used.

The keys mentioned in the teco.doc file are somewhat confusing. This should help:
The Esc echoes as $, however the teco.doc file shows it as `.
Type as Control-H; this isn't the Backspace key.
The Backspace key; this isn't the Delete key.
The Enter key.
Type as Control-J.

Note that the assignments for <BS> and <DELETE> shown here are swapped. <BS> can be Backspace and <DELETE> can be Control-H by clearing ET&2048, e.g. 2048,0ET

teco mungs (executes as teco commands) the file TECO.INI (yes, in uppercase) in the current directory before processing the command line. Initialisation can be done instead by defining an environment variable named TEC_INIT. The value is either the list of teco commands to execute, or a $ followed by the pathname of the initialisation file. This allows a single, centrally located initialisation file. Remember that the $ must be escaped with a backslash character.

The initialisation file can be used to make initial settings. It can return a value, but the value setting is somewhat obscure.

For example, the following will both cause successful searches to auto-display in all teco sessions.

Example (csh):
TEC_INIT 1es
Example (bash):

export TEC_INIT

The following will each cause the file ~/.tecrc to be used as the initialisation file.

Example (csh):
Example (bash):

export TEC_INIT

teco tries to remember the last file that it edited, so that after a file has been edited once, it can be re-edited without the file name having to be repeated on the command line. teco implements this by writing and reading a file that contains the name of the last file edited. By default, the file name is tecoN.tmp in the current directory, where N is the process ID of the parent process to teco.

To change the location of the memory file, define the environment variable TEC_MEMORY to be $ followed by the pathname of the file to be designated as the memory file. Remember that the $ must be escaped with a backslash character.

The following examples will cause the name of the last file edited to be stored in the file teco.mem in the home directory.

Example (csh):
Example (bash):

export TEC_MEMORY

The environment variable TEC_LIBRARY can be set to be a directory path (including the final /); the path must be preceded by a $ character. This allows the EI command to fetch teco commands from this directory if the file is not found in the current directory. Remember that the $ must be escaped with a backslash character.

Example (csh):
Example (bash):

export TEC_LIBRARY

This will cause the directory /usr/local/lib to be searched for teco command files.

There are a number of flags that can be set inside teco, using the ED and ET mode control commands. To add functionality, teco is also sensitive to bits in an extra mode control flag, EZ. Bits in the EZ mode control command are used in different ways by different operating systems; only those relevant to FreeBSD are described here.

Allow the caret ^ character in string searches.
Allow yank and _ unconditionally.
Failed searches preserve dot.
Move dot by one after each match in multiple occurrence searches.

Type out in image mode.
Use scope for delete and Control-U (default=1)
Accept lowercase input (default=1).
reads without echo.
reads with no wait.
mung mode (abort on error); cleared by * prompt.
Swap backspace and delete.
We are using 8 bit characters (default=1).
Trap Control-C.

If set, don't stop on form feeds when reading. If clear, a form feed in the input stream stops the read (the standard teco style). This bit is off by default.
If set, use UNIX-style newline terminators. This means when files are read in, carriage-returns are not added to the end of lines, and when the user types the RETURN key, only a newline is entered into the command line (usually a carriage-return/line-feed pair is entered). Old macros (and old teco users) may get confused if this bit is set.
Normally, the backup file name is created by replacing the file extension with .bak - foo.c becomes foo.bak; however, if this bit is set then the backup file name is created by simply adding .bak to the name - foo.c becomes foo.c.bak. This choice is overridden by EZ&1 = 0.

The following environment variables are used by teco:
The value of this variable can be either a teco command string, or the name of a file containing teco commands. The filename must be preceded by a $ character. Remember that the $ must be escaped with a backslash character. See also Initialisation file.
The value of this variable should be a path to the directory that contains files of teco commands, to be accessed using XX. The pathname should include the trailing /. Remember that the $ must be escaped with a backslash character. See also Library directory.
The value of this variable should be the name of a file To be used for remembereing the name of the last file edited by teco. The filename must be preceded by a $ character. Remember that the $ must be escaped with a backslash character. See also Filename memory.

/usr/local/share/teco/*
Miscellaneous teco macros and commands.
/usr/local/share/doc/teco/teco.doc
The teco manual (if installed).
/usr/local/share/doc/teco/wchart.txt
Summary of teco keystrokes (if installed).

The teco utility exits 0 on success, and >0 if an error occurs.

A variety of documentation files may be installed in /usr/local/share/doc/teco. Apart from the ones mentioned in the FILES section, they are of limited use, because they refer to slightly different versions of teco.

There are also many online resources.

Pete Siemsen ⟨siemsen@usc.edu⟩.

Tom Almy ⟨tomalmy@aracnet.com⟩.
FreeBSD port and manual page maintained by
Bob Eager ⟨bob@eager.cx⟩.

There is no video mode.
September 5, 2018 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.