ACCC Home Page ACADEMIC COMPUTING and COMMUNICATIONS CENTER
Accounts / Passwords Email Labs / Classrooms Telecom Network Security Software Computing and Network Services Education / Teaching Getting Help
 

THE - The Hessling Editor
The Profile File (.therc)

 

The Default Profile

Various session defaults may be changed on startup for an individual by using a profile file.

A profile is used to:

  • set the current environment, including key bindings, and

  • process commands in batch mode.

The profile for XEDIT is named PROFILE XEDIT and usually it resides on a user's 191 disk. The profile for THE is called .therc and it resides in the home directory of THE. That profile is the default profile and, on all UIC-based UNIX platforms (Tigger, Icarus, and Borg), gives THE the "look and feel" of XEDIT.

If you

  • do not tell THE to use a specific profile via the -p command line option

  • do not have your own profile in your home directory

THE will use the default profile.

Making your own profile file (Customizing THE)

If you wish to have your own profile for THE, perhaps to define special keys or to override system settings, you start by coping the default profile to your home directory:

On Borg cd
cp /usr/local/src/the/THE/.therc .
chmod 744 .therc
On Icarus cd
/usr/local/src/the-2.2/THE/.therc .
chmod 744 .therc
On Tigger cd
cp /usr/local/src/the/THE/.therc .
chmod 744 .therc

From now on, THE will use the .therc file in your home directory as its profile. You can make any additions or changes you wish.

Batch Processing in the Profile

A profile file can be used to process commands in batch mode. For example, to change all occurrences of 'alligator' to 'crocodile' in the file file.ext in batch mode, a profile file (prf.prf) with the following commands would be used:

----------
'c/alligator/crocodile/ * *'
'file'
----------

and the command

----------
the -b -p prf.prf file.ext
----------

would be issued.

This changes the first string enclosed in delimiters (generally any non-alphabetic character not in the string itself) to the second string for every line (*) starting at the current line (0 initially) changing each occurrence on a line (*).

Maybe you only want to change a string after the first line that contains the string donkey , but only change the second occurrence of that string. The profile commands would then be:

----------
'/donkey/'
'c/alligator/crocodile/ * 1 2'
'file'
----------

The CHANGE uses a target specification as its first parameter after the string details. A target can be a number of lines, an absolute line number, BLANK, ALL or a string.

Number of line targets consist of either a positive integer, for referencing lines toward the end of the file, negative for referencing toward the start of the file or * , which is all the remaining lines in the file or -* which is all lines toward the start of the file.

An absolute line number in the form of :n is the line number in a file, starting with line number 1.


Return to the index.


The Hessling Editor is Copyright © Mark Hessling, 1990-1998 <M.Hessling@qut.edu.au>
Last modified: May 17, 1999
 


2000-2-16  document@uic.edu
UIC Home Page Search UIC Pages Contact UIC