Applicable commands include 'm' (mark as unread), 'M' (mark as read-until-exit), 'j' (mark as read), "s dest" (save to a destination), "e dir" (extract to directory), "!command" (shell escape), "=" (print the subject), '+'/'-' (select/deselect the article), 'T+' (auto-select the entire thread), 'Tj' (auto- junk the entire thread), "++"/"--" (select/deselect the associated thread), 'C' (cancel), as well as S, |, w, W, and t.
:command Apply a command to all selected articles. If nothing is selected, nothing is done. For applicable commands, see the discussion above for the range command.
j Junk the current article (i.e. mark it as read). If this command is used from within an article, you are left at the end of the article, unlike 'n', which looks for the next article.
m Mark the current article as still unread. (If you don't want to see this article for a while you're probably better off using M instead of m, otherwise this article might get picked again as the first available article sooner than you'd like.)
M Mark the current article to return on newsgroup exit. Until then, the current article will be marked as read. This is useful for returning to an article in another session.
Y Yank back the marked-to-return articles, clearing their to-return status. If you are reading selected articles, the yanked articles come back selected.
/pattern Scan forward for article containing pattern in the subject. See the Regular Expressions section. Together with the escape substitution facility described later, it becomes easy to search for
Page 13 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
various attributes of the current article, such as subject, article ID, author name, etc. The previous pattern can be recalled with ESC. If pattern is omitted, the previous pattern is assumed.
/pattern/f Scan forward for article containing pattern in the from line. If you are using thread files the article data you are matching against MAY contain only the real name of the user. If you want to always match the full from line, see the following header-matching option that will read in the full from-line data if it is not already available.
/pattern/Hheader Scan forward for article containing pattern in the indicated header. Because we scan the entire string up to the end of the modifiers, this modifier must be the last one. For example, "/jsmoe@somesite.com/rHfrom:m+" will mark all articles from "jsmoe@somesite.com" as unread and select them. Note that if the header line isn't one that trn recognizes in its header parser, you'll have to use the following full-header matching.
/pattern/h Scan forward for article containing pattern in the header.
/pattern/a Scan forward for article containing pattern anywhere in the article.
/pattern/r Scan read articles also.
/pattern/c Make search case sensitive. Ordinarily upper- and lower-case are considered the same.
/pattern/I Force the search to ignore the THRU line when executed as a memorized command. If the command portion is a selection command (i.e. it starts with a '+' or a '.') this is the default behavior.
/pattern/N Force the search to NOT ignore the THRU line when executed as a memorized command (useful on selection commands -- see also -k).
Page 14 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
/pattern/modifiers:command{:command} Apply the commands listed to articles matching the search command (possibly with h, a, or r modifiers). Applicable commands include 'm' (mark as UNread), 'M' (mark as read-until-exit), 'j' (junk -- mark as read in all groups), 'x' (mark as read in this group), "s dest" (save to a dest), "e dir" (extract to dir), "!command" (shell escape), "=" (print the subject), '+' (select the article), '-' deselect the article, 'T+' (auto-select the entire thread), 'Tj' (auto-junk the entire thread), "++" (select the associated thread), "--" deselect the associated thread), and 'C' (cancel). If the first command is 'm' or 'M', modifier r is assumed. A K may be included in the modifiers (not the commands) to cause the entire command (sans K) to be saved to the local KILL file, where it will be applied to every article that shows up in the newsgroup.
For example, to save all articles in a given newsgroup to the line printer and mark them read, use "/^/|lpr:j". If you type "/^/K|lpr:j", this will happen every time you enter the newsgroup.
?pattern Scan backward for article containing pattern in the subject. May be modified as the forward search is: ?pattern?modifiers[:commands]. It is likely that you will want an r modifier when scanning backward.
k Mark as read all articles with the same subject as
the current article. (Note: there is no single
character command to temporarily mark as read (M
command) articles matching the current subject.
That can be done with "/
, Mark the current article and all its replies as
read.
J Junk all the articles in the current thread, even if
it contains multiple subjects.
A Add a subject-search command to the memorized list
for this group (in the KILL file). You are prompted
to choose selection (+), junking (j), selection
including all replies (.) or junking including all
replies (,).
K This is a synonym for the command "Aj" which adds a
command to junk the current subject to the memorized
commands for the group. See also the K modifier on
searches above.
Page 15 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
T Add a thread-oriented command to the memorized list
for this group. You are prompted to choose
selection of entire thread (+), junking of entire
thread (j), selection of an article and its replies
(.), junking of an article and its replies (,),
clearing the auto-selection/junking for this thread
(c), or clearing the auto-selection/junking for an
article and its replies (C).
^K Edit the local list of memorized commands (a.k.a. a
KILL file) for this newsgroup. Each line of the
KILL file is either a subject-affecting command of
the form /pattern/x or a thread-affecting command of
the form
To see only newgroup articles in the control
newsgroup, for instance, you might include the line
/newgroup/:+
which selects all subjects containing "newgroup".
You can add lines automatically via the A and T
commands as well as the K search modifier, but
editing is the only way to remove subject commands
(thread commands die automatically as the thread
dies). If either of the environment variables
VISUAL or EDITOR is set, the specified editor will
be invoked; otherwise a default editor (normally vi)
is invoked on the KILL file.
The KILL file may also contain switch-setting lines
beginning with '&' (see the section on "Options")
and special commands beginning with '*'. There are
two such commands at the moment: "*j" (junk all
articles from THRU to the end of the group) and "*X"
(junk all unselected articles from THRU to the end
of the group). Additionally, any line beginning
with 'X' is executed on exit from the newsgroup
Page 16 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
rather than on entrance. This can be used to set
switches back to a default value. One use for this
capability is to set your save directory to a custom
value upon entry to a newsgroup and set it back on
exit using the -ESAVEDIR option. See also the -/
option for another solution to multiple save
directories without using KILL files.
r Reply through net mail. The environment variables
MAILPOSTER and MAILHEADER may be used to modify the
mailing behavior of trn (see the environment
section). If the current article does not exist
(such as the "End of newsgroup" pseudo-article you
can get to with a '$' command), invokes the mailer
to nobody in particular.
R Reply, including the current article in the header
file generated. (See 'F' command below). The
YOUSAID environment variable controls the format of
the attribution line.
^F Forward the current article.
f Submit a follow-up article. If the current article
does not exist (such as the "End of newsgroup"
pseudo-article you can get to with a '$' command),
posts an original (root) article.
F Submit a follow-up article, and include the old
article, with lines prefixed either by ">" or by the
argument to the -F switch. Trn will attempt to
provide an attribution line in front of the quoted
article, generated from the From: line of the
article. Unfortunately, the From: line doesn't
always contain the right name; you should double
check it against the signature and change it if
necessary, or you may have to apologize for quoting
the wrong person. The environment variables
NEWSPOSTER, NEWSHEADER and ATTRIBUTION may be used
to modify the posting behavior of trn (see
environment section).
C Cancel the current article, but only if you are the
contributor or superuser.
z Supersede the current article, but only if you are
the contributor.
Z Same as the 'z' command, but you start with a copy
of the original article to work with.
Page 17 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
c Catch up in this newsgroup; i.e., mark all articles
as read.
U Mark some or all articles as unread. You can choose
to mark the current thread, sub-thread (the current
article and its replies), all the articles, or start
up the selector to choose specific articles to set
unread.
u Unsubscribe from this newsgroup.
s destination
Save to a filename or pipe using sh. If the first
character of the destination is a vertical bar, the
rest of the command is considered a shell command to
which the article is passed through standard input.
The command is subject to filename expansion. (See
also the environment variable PIPESAVER.) If the
destination does not begin with a vertical bar, the
rest of the command is assumed to be a filename of
some sort. An initial tilde '~' will be translated
to the name of the home directory, and an initial
environment variable substitution is also allowed.
If only a directory name is specified, the
environment variable SAVENAME is used to generate
the actual name. If a non-absolute filename is
specified, the environment variable SAVEDIR will be
used to generate the actual directory. If nothing
is specified, then obviously both variables will be
used. Since the current directory for trn while
doing a save command is your private news directory,
typing "s ./filename" will force the file to your
news directory. Save commands are also run through
% interpretation, so that you can enter "s
%O/filename" to save to the directory you were in
when you ran trn, and "s %t" to save to a filename
consisting of the Internet address of the sender.
After generating the full pathname of the file to
save to, trn determines if the file exists already,
and if so, appends to it. trn will attempt to
determine if an existing file is a mailbox or a
normal file, and save the article in the same
format. If the output file does not yet exist, trn
will by default ask you which format you want, or
you can make it skip the question with either the -M
or -N switch. If the article is to be saved in
mailbox format, the command to do so is generated
from the environment variable MBOXSAVER. Otherwise,
NORMSAVER is used.
Page 18 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
S destination
Save to a filename or pipe using a preferred shell,
such as csh. Which shell is used depends first on
what you have the environment variable SHELL set to,
and in the absence of that, on what your news
administrator set for the preferred shell when he or
she installed trn.
| command
Shorthand for "s | command".
w destination
The same as "s destination", but saves without the
header.
W destination
The same as "S destination", but saves without the
header.
e directory
Extract a shell archive or uuencoded binary to the
designated directory. The article is first scanned
to try discover what type of data is encapsulated.
If a "cut here" line is found, the first non-blank
line after it must be either the start of a shar
header, or the "begin" or "table" line of a
uuencoded binary. The default for extracting shars
is to send the data portion of the file to /bin/sh,
but that can be overridden with the UNSHAR variable
(see the ENVIRONMENT section). Uudecoding is done
internally by a decoder that can handle the data
being split up over multiple articles, and extracted
one piece at a time. To decode a multi-article
file, either execute the 'e' command in each article
in sequence, use an article range to execute the
command, or use the ":e" command to repeat the
command for each of the currently selected articles.
When the 'e' command is not followed by any
arguments, it will repeat the arguments from the
last extraction. All directory specifications are
relative to the value of SAVEDIR, so you can use the
command "e ." to force an extraction to SAVEDIR
itself. If a uudecoding is in progress (i.e. the
last piece wasn't extracted yet) and you exit the
group, the partial file will be removed. This also
occurs if you start to extract a new uuencoded file
before the previous one was finished. See also the
'E' command for ending a multi-part uudecoding
manually.
There is one special case that is handled
differently: if the first file in a recognizable
Page 19 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
shar file is a uuencoded binary that was packed with
lines starting with an 'X', we will not unshar the
file but instead uudecode it. If this causes
problems, you can override the default extraction
method by following the directory with an explicit
command to execute, as described below.
e directory|command
This form of the 'e' command allows you to extract
other data formats than shar or uuencoded files or
to override the decisions made by the automatic
extraction selection described above. In normal
operation, all data following what we recognize as a
"cut here" line will be sent to the specified
command. Additionally, the distinctive beginning of
a shell archive is also recognized without a
preceding cut line. When the command is run, the
default directory will be set to the specified
directory, or the value of SAVEDIR if unspecified.
Entering the 'e' command without arguments will
repeat your previous extract command. You can use
the command "e dir|" to extract to a new directory
using the previously-specified command.
E This command ends any multi-part uuencoded file
extraction that you began, but are unable (or
unwilling) to complete. The partially extracted
file is removed.
& Print out the current status of command-line
switches.
&switch {switch}
Set additional command-line switches.
&& Print out current macro definitions.
&&keys commands
Define an additional macro.
!command
Escape to a subshell. One exclamation mark (!)
leaves you in your own news directory. A double
exclamation mark (!!) leaves you in the spool
directory of the current newsgroup. The environment
variable SHELL will be used if defined. If command
is null, an interactive shell is started.
You can use escape key substitutions described later
to get to many run-time values. The command is also
run through % interpretation, in case it is being
called from a range or search command.
Page 20 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
+ Start the selector in the last-used mode. If the
newsgroup is unthreaded and the default selector
mode is threads, we temporarily switch to subject
selection unless manually overridden.
_a Start the selector in article mode.
_s Start the selector in subject mode.
_t Start the selector in thread mode.
_T Start the selector in thread mode unless the group
isn't threaded, in which case we settle for the
subject selector.
= List subjects of unread articles.
# Print last article number.
_+ Select the entire thread associated with the current
article.
_- Deselect the entire thread associated with the
current article.
Pager Level
At the pager level (within an article), the prompt looks
like this:
--MORE--(17%)
and a number of commands may be given:
SP Display next page.
x Display next page and decrypt as a rot13 message.
d Display half a page more.
CR Display one more line.
q Go to the end of the current article (don't mark it
either read or unread). Leaves you at the "What
next?" prompt.
j Junk the current article. Mark it read and go to
the end of the article.
^L Refresh the screen.
Page 21 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
X Refresh the screen and decrypt as a rot13 message.
b Back up one page.
_C Switch to next available charset conversion.
t Display the entire article tree, including its
associated subjects, and continue reading. If the
group is not currently threaded, it will be threaded
first.
gpattern
Goto (search forward for) pattern within current
article. Note that there is no space between the
command and the pattern. If the pattern is found,
the page containing the pattern will be displayed.
Where on the page the line matching the pattern goes
depends on the value of the -g switch. By default
the matched line goes at the top of the screen.
G Search for g pattern again.
^G This is a special version of the 'g' command that is
for skipping articles in a digest. It is equivalent
to setting "-g4" and then executing the command
"g^Subject:".
TAB This is another special version of the 'g' command
that is for skipping inclusions of older articles.
It is equivalent to setting "-g4" and then executing
the command "g^[^c]", where c is the first character
of the last line on the screen. It searches for the
first line that doesn't begin with the same
character as the last line on the screen.
!command
Escape to a subshell.
The following commands skip the rest of the current article,
then behave just as if typed to the "What next?" prompt at
the end of the article. See the documentation at the
article selection level for these commands.
# $ & / = ? A c C f F k K T ^K J , m M r R ^R u U v Y ^
p P ^P - < > [ ] { } number
range{,range} command{:command}
The following commands also skip to the end of the article,
but have the additional effect of marking the current
article as read:
n N ^N e s S | w W
Page 22 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
Miscellaneous facts about commands
An 'n' typed at either the "Last newsgroup" prompt or a
"Last article" prompt will cycle back to the top of the
newsgroup or article list, whereas a 'q' will quit the
level. (Note that 'n' does not mean "no", but rather
"next".) A space will of course do whatever is shown as the
default, which will vary depending on whether trn thinks you
have more articles or newsgroups to read.
The 'b' (backup page) command may be repeated until the
beginning of the article is reached. If trn is suspended
(via a ^Z), then when the job is resumed, a refresh (^L)
will automatically be done (Berkeley-type systems only). If
you type a command such as '!' or 's' which takes you from
the middle of the article to the end, you can always get
back into the middle by typing '^L'.
In multi-character commands such as '!', 's', '/', etc, you
can interpolate various run-time values by typing escape and
a character. To find out what you can interpolate, type
escape and 'h', or check out the single character %
substitutions for environment variables in the
Interpretation and Interpolation section, which are the
same. Additionally, typing a double escape will cause any %
substitutions in the string already typed in to be expanded.
The Tree Display
When reading a threaded newsgroup, trn displays a character
representation of the article tree in the upper right corner
of the header. For example, consider the following display:
(1)+-(1)--(2)--[2]
|-(1)+-<3>
| \-[1]
\-(1)+-[1]--[1]
\-[1]
This tree represents an initial article that has three
direct replies (the second column with three (1)'s). Each
reply has further replies branching off from them. In two
cases the subject line was altered in the reply, as
indicated by the increasing numbers.
The third subject is not selected for reading, as indicated
by the <>'s. Note you can always forcefully visit an
unselected article with 'N' and 'P' as well as the thread-
navagation commands (which are typically macro'ed to the
arrow keys on your keypad).
When there is only one subject associated with a thread, all
Page 23 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
the nodes are marked with the number 1. When the first
subject change arrives, it is marked with the number 2, and
so on. If you were to look at this thread in the thread
selector, the three subjects associated with it would be
listed in the same order as the ascending digits. In those
rare cases where more than 9 subjects are associated with
each thread, the nodes are marked with the letters A-Z, and
then by a-z.
The articles that have already been read are enclosed in
()'s, Unread articles are displayed in []'s, and unread-
but-unselected articles are displayed in <>'s. The
currently displayed article has its entire node highlighted
in the display. The previously displayed article has only
its number highlighted. If the group has not been
completely threaded yet, some articles will appear as (?)
until trn can determine if the referenced article truly
exists or not. If you visit such an article and wait for
trn to finish threading the group, the screen will refresh
as soon as the presence or absence of the article is
determined.
Options
Trn has a nice set of options to allow you to tailor the
interaction to your liking. (You might like to know that
the author swears by "-x6ms +e -mu -S -XX -N -B -p".) These
options may be set on the command line, via the TRNINIT
environment variable, via a file pointed to by the TRNINIT
variable, or from within trn via the & command. Options may
generally be unset by typing "+switch". Options include:
-a causes trn to always thread the unread articles on
entry to a group. Without this option trn may enter a
group in a partially-threaded state and process the
unthreaded articles in the background. The down side
of this is that the tree display may not be complete
when it is first displayed and you may start out at an
odd position in the first thread's article tree.
-A tells trn to attempt to create some default macros that
will map your arrow keys to useful trn functions (this
is the default). Use +A to turn this behavior off.
-b will force trn to read each thread in a breadth-first
order, rather than depth-first.
-B will turn on a spinner that twirls when trn is doing
background article-processing. A gizmo for those
interested in what's going on behind the scenes.
-c checks for news without reading news. If a list of
Page 24 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
newsgroups is given on the command line, only those
newsgroups will be checked; otherwise all subscribed-to
newsgroups are checked. Whenever the -c switch is
specified, a non-zero exit status from trn means that
there is unread news in one of the checked newsgroups.
The -c switch does not disable the printing of
newsgroups with unread news; this is controlled by the
-s switch. (The -c switch is not meaningful when given
via the & command.)
-C
-d
-D
-e causes each page within an article to be started at the
top of the screen, not just the first page. (It is
similar to the -c switch of more(1).) You never have
to read scrolling text with this switch. This is
helpful especially at certain baud rates because you
can start reading the top of the next page without
waiting for the whole page to be printed. It works
nicely in conjunction with the -m switch, especially if
you use half-intensity for your highlight mode. See
also the -L switch.
-E
Page 25 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
"setenv SAVENAME '%t'" in csh, or "SAVENAME='%t';
export SAVENAME" in sh. Any environment variables set
with -E will be inherited by subprocesses of trn.
-f will make trn avoid various sleep calls and the prompt
after the processing of the memorized commands that are
intended to allow you time to read a message before the
screen clears. This allows the advanced user to cruise
along a little faster at the expense of readability.
The -t (terse) option turns on -f by default, but you
can override this by specifying +f after the -t option.
-F
-g
-G selects the "fuzzy" processing on the go command when
you don't type in a valid group name. With this option
on trn will attempt to find the group you probably
meant to type, but it can be a little slow about it, so
it's not on by default.
-h
-H
Page 26 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
for that header line. Certain header lines have magic
behavior that can be controlled this way. At present,
the following actions are caused by the flag for the
particular line: the Date line prints the date in
local time if the group is threaded; the From line will
only print the commented portion of the user name; the
Newsgroups line will only print when there are multiple
newsgroups; the Subject line will be underlined and
(when threaded) the keyword 'Subject:' is replaced by
its subject number (e.g. [1]); and the Expires line
will always be suppressed if there is nothing on it.
In fact, all of these actions are the default, and you
must use +H to undo them.
-i=
-I tells trn to append all new, unsubscribed groups to the
end of the .newsrc.
-j forces trn to leave control characters unmolested in
messages.
-J{
&-J30
X&+J
-k tells trn to ignore the THRU line when processing
selection searches (i.e. searches with a command
portion that starts with a '+' or a '.') in the
memorized commands (aka kill files). This is turned on
by default, so use +k if you want to turn it off.
-K is used to keep a trn from checking for new news while
you're in the group. Use this when your kill-file
processing is so slow that you don't want the group to
expand while you're reading. If you only want specific
groups to be affected, put these lines into your kill
file for the group(s):
Page 27 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
&-K
X&+K
-l disables the clearing of the screen at the beginning of
each article, in case you have a bizarre terminal.
-L tells trn to leave information on the screen as long as
possible by not blanking the screen between pages, and
by using clear to end-of-line. (The more(1) program
does this.) This feature works only if you have the
requisite termcap capabilities. The switch has no
effect unless the -e switch is set.
-m=
-M forces mailbox format in creating new save files.
Ordinarily you are asked which format you want.
-N forces normal (non-mailbox) format in creating new save
files. Ordinarily you are asked which format you want.
-o will act like old versions of trn and not junk cross-
referenced articles when using thread commands to junk
articles in the current group (such as the selector's
'X' command).
-O
-p{opt}
tells trn to auto-select your postings and their
replies as it encounters them in the various groups you
read. The optional parameter is either a '.', 'p', or
'+' (it defaults to '.' if omitted) and affects what
command trn should execute when it encounters your
Page 28 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
postings. The default is to execute the command "T."
on each of your postings which tells trn to memorize
the auto-selection of this article and all its replies.
Using -pp tells trn to use the same command, but start
the selection with the parent article, so that you see
any other replies to the same article. Using -p+ tells
trn to select the whole thread that contains your
reply.
-q bypasses the automatic check for new newsgroups when
starting trn.
-Q
-r causes trn to restart in the last newsgroup read during
a previous session with trn. It is equivalent to
starting up normally and then getting to the newsgroup
with a g command.
-s with no argument suppresses the initial listing of
newsgroups with unread news, whether -c is specified or
not. Thus -c and -s can be used together to test
"silently" the status of news from within your .login
file. If -s is followed by a number, the initial
listing is suppressed after that many lines have been
listed. Presuming that you have your .newsrc sorted
into order of interest, -s5 will tell you the 5 most
interesting newsgroups that have unread news. This is
also a nice feature to use in your .login file, since
it not only tells you whether there is unread news, but
also how important the unread news is, without having
to wade through the entire list of unread newsgroups.
If no -s switch is given -s5 is assumed, so just
putting "rn -c" into your .login file is fine.
-S
-t puts trn into terse mode. This is more cryptic but
useful for low baud rates. (Note that your system
administrator may have compiled trn with either verbose
Page 29 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
or terse messages only to save memory.) You may wish
to use the baud-rate switch modifier below to enable
terse mode only at lower baud rates.
-T allows you to type ahead of trn. Ordinarily trn will
eat typeahead to prevent your autorepeating space bar
from doing a very frustrating thing when you
accidentally hold it down. If you don't have a
repeating space bar, or you are working at low baud
rate, you can set this switch to prevent this behavior.
You may wish to use the baud-rate switch modifier below
to disable typeahead only at lower baud rates.
-u sets the unbroken-subject-line mode in the selector,
which simply truncates subjects that are too long
instead of dumping the middle portion prior to the last
two words of the subject.
-U tells trn to not write the .newsrc file out after
visiting each group. While this is "unsafe" it can be
faster if you have a really huge .newsrc.
-v sets verification mode for commands. When set, the
command being executed is displayed to give some
feedback that the key has actually been typed. Useful
when the system is heavily loaded and you give a
command that takes a while to start up.
-x{
-X{
Page 30 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
articles, and set the default command for the LAST page
of the thread selector to be the X command and the
default command for all other pages to be the D
command. Either or both parameters can be omitted, as
well as the second default command (e.g. -XX would
change the default newsgroup entry to use the selector
and the default command for the last page of the
selector to be 'X'). The default is -X1Z> if just -X
is specified. To set the default selector commands
without having '+' be the default entry into a
newsgroup, specify a high number, like 9999.
-z sets the minimum number of minutes that must elapse
before the active file is refetched to look for new
articles. A value of 0 or using +z turns this off.
-Z is used to select what style of database you want trn
to access. Use -Zt for thread files, -Zo for overview
files, and +Z for none. The default is whatever your
newsadmin compiled into trn, and can be -Zot to try to
access either one.
-/ sets SAVEDIR to "%p/%c" and SAVENAME to "%a", which
means that by default articles are saved in a
subdirectory of your private news directory
corresponding to the name of the the current newsgroup,
with the filename being the article number. +/ sets
SAVEDIR to "%p" and SAVENAME to "%^C", which by default
saves articles directly to your private news directory,
with the filename being the name of the current
newsgroup, first letter capitalized. (Either +/ or -/
may be default on your system, depending on the
feelings of your news administrator when he, she or it
installed trn.) You may, of course, explicitly set
SAVEDIR and SAVENAME to other values -- see discussion
in the environment section.
Any switch may be selectively applied according to the
current baud-rate. Simply prefix the switch with +speed to
apply the switch at that speed or greater, and -speed to
apply the switch at that speed or less. Examples:
-1200-hposted suppresses the Posted line at 1200 baud or
less; +9600-m enables marking at 9600 baud or more. You can
apply the modifier recursively to itself also: +300-1200-t
sets terse mode from 300 to 1200 baud.
Similarly, switches may be selected based on terminal type:
-=vt100+T set +T on vt100
-=tvi920-ETERM=mytvi get a special termcap entry
-=tvi920-ERNMACRO=%./.rnmac.tvi
set up special key-mappings
Page 31 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
+=paper-v set verify mode if not hardcopy
Some switch arguments, such as environment variable values,
may require spaces in them. Such spaces should be quoted
via ", ', or \ in the conventional fashion, even when passed
via TRNINIT or the & command.
Regular Expressions
The patterns used in article searching are regular
expressions such as those used by ed(1). In addition, \w
matches an alphanumeric character and \W a non-alphanumeric.
Word boundaries may be matched by \b, and non-boundaries by
\B. The bracketing construct \( ... \) may also be used,
and \digit matches the digit'th substring, where digit can
range from 1 to 9. \0 matches whatever the last bracket
match matched. Up to 10 alternatives may given in a
pattern, separated by \|, with the caveat that
\( ... \| ... \) is illegal.
Characterset conversions
trn can use character set conversions when displaying
articles. This helps users in non-English-speaking countries
to display special characters on 7-bit displays. trn
assumes that articles use the ISO-8859-1 character set and
converts the special characters (e.g., "umlauts") to a
string of ASCII characters. Currently the following
conversions are supported (see the -Q option):
p Plain. No change. This is the default.
a ISO->ASCII. Special characters are mapped to ASCII,
e.g. the umlaut-o character becomes oe.
m ISO->ASCII monospaced. Special characters are mapped to
exactly one similar-looking ASCII character, e.g.
umlaut-o becomes o. Used where correct spacing is more
important than accuracy.
t TeX->ISO. Assuming your display can handle the ISO-
8859-1 charset, trn transforms umlauts in the TeX
notation, which is commonly used in Germany, to real
ISO characters, e.g. "a becomes umlaut-a.
The selected conversion, if different from p, will be
displayed in the article level and pager prompt. The
conversion is also used when including original articles in
a reply or followup. It is not used when saving articles to
files.
Page 32 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
Interpretation and Interpolation
Many of the strings that trn handles are subject to
interpretations of several types. Under filename expansion,
an initial "~/" is translated to the name of your home
directory, and "~name" is translated to the login directory
for the user specified. Filename expansion will also expand
an initial environment variable, and also does the
backslash, caret and percent expansion mentioned below.
All interpreted strings go through backslash, caret and
percent interpretation. The backslash escapes are the
normal ones (such as \n, \t, \033, etc.). The caret escapes
indicate control codes (such as ^i, ^l, etc.). If you wish
to pass through a backslash or a caret it must be escaped
with a backslash. The special percent escapes are similar
to printf percent escapes. These cause the substitution of
various run-time values into the string. The following are
currently recognized:
%a Current article number.
%A Full name of current article (%P/%c/%a).
%b Destination of last save command, often a mailbox.
%B The byte offset to the beginning of the part of the
article to be saved, set by the save command. The
's' and 'S' commands set it to 0, and the 'w' and
'W' commands set it to the byte offset of the body
of the article.
%c Current newsgroup, directory form.
%C Current newsgroup, dot form.
%d Full name of newsgroup directory (%P/%c).
%D "Distribution:" line from the current article.
%e The last command executed to extract data from an
article.
%E The last directory where an extracted file went.
%f "From:" line from the current article, or the
"Reply-To:" line if there is one. This differs
from %t in that comments (such as the full name) are
not stripped out with %f.
%F "Newsgroups:" line for a new article, constructed
from "Newsgroups:" and "Followup-To:" lines of
Page 33 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
current article.
%h Name of the header file to pass to the mail or news
poster, containing all the information that the
poster program needs in the form of a message
header. It may also contain a copy of the current
article. The format of the header file is
controlled by the MAILHEADER and NEWSHEADER
environment variables.
%H Host name (your machine's name).
%i "Message-I.D.:" line from the current article, with
<> guaranteed.
%I The reference indication mark (see the -F switch.)
%l The news administrator's login name, if any.
%L Login name (yours).
%m The current mode of trn, for use in conditional
macros.
i Initializing.
n Newsgroup-selection level.
f end (Finis) of newsgroup-selection level.
t the Thread/subject/article selector.
a Article level (What next?).
e End of the article level.
p Pager level (MORE prompt).
u Set-unread prompt.
d selector moDe prompt.
o selector Order prompt.
m Memorize thread command prompt.
r memoRize subject command prompt.
k processing memorized (KILL file) commands.
A Add this newsgroup?
B aBandon confirmation.
C Catchup confirmation.
D Delete bogus newsgroups?
F Is follow-up a new topic?
M Use mailbox format?
R Resubscribe to this newsgroup?
Note that yes/no questions are all upper-case modes.
If, for example, you wanted to disallow defaults on
all yes/no questions, you could define the following
macro:
\040 %(%m=[A-Z]?h: )
Page 34 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
%M The number of articles marked to return via the 'M'
command. If the same article is Marked multiple
times, "%M" counts it multiple times in the current
implementation.
%n "Newsgroups:" line from the current article.
%N Full name (yours).
%o Organization (yours).
%O Original working directory (where you ran trn from).
%p Your private news directory, normally ~/News.
%P Public news spool directory, normally
/usr/spool/news on systems that don't use NNTP.
%q The value of the last "quoted" input string (see the
%" interp).
%r Last reference on references line of current article
(parent article id).
%R References list for a new article, constructed from
the references and article ID of the current
article.
%s Subject, with all Re's and (nf)'s stripped off.
%S Subject, with one "Re:" stripped off.
%t "To:" line derived from the "From:" and "Reply-To:"
lines of the current article. This always returns
an Internet format address.
%T "To:" line derived from the "Path:" line of the
current article to produce a uucp path.
%u The number of unread articles in the current
newsgroup.
%U The number of unread articles in the current
newsgroup, not counting the the current article.
When threads are selected, this count reflects only
selected articles.
%v The number of unselected articles, not counting the
current article if it is unselected.
%w The directory where mthreads keeps its tmp files.
Page 35 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
%W The directory where thread files are placed.
%x The news library directory.
%X The trn library directory.
%z The length of the current article in bytes.
%Z The number of selected threads.
%~ Your home directory.
%. The directory containing your dot files, which is
your home directory unless the environment variable
DOTDIR is defined when trn is invoked.
%# The current count for a multi-file save, starting
with 1. This value is incremented by one for each
file saved or extracted within a single command.
%$ Current process number.
%/ Last search string.
%? A space unless the current interp string is > 79
characters, at which point it turns into a newline.
%% A percent sign.
%{name} or %{name-default}
The environment variable "name".
%[name] The value of header line "Name:" from the current
article. The "Name: " is not included. For example
"%D" and "%[distribution]" are equivalent. The name
must be spelled out in full.
%`command`
Inserts the output of the command, with any embedded
newlines translated to space.
%"prompt"
Prints prompt on the terminal, then inputs one
string, and inserts it.
%(test_text=pattern?then_text:else_text)
If test_text matches pattern, has the value
then_text, otherwise else_text. The ":else_text" is
optional, and if absent, interpolates the null
string. The = may be replaced with != to negate the
test. To quote any of the meta-characters ('=',
'?', ':', or ')'), precede with a backslash.
Page 36 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
%digit The digits 1 through 9 interpolate the string
matched by the nth bracket in the last pattern match
that had brackets. If the last pattern had
alternatives, you may not know the number of the
bracket you want -- %0 will give you the last
bracket matched.
Modifiers: to capitalize the first letter, insert '^':
"%^C" produces something like "Rec.humor". Inserting '_'
causes the first letter following the last '/' to be
capitalized: "%_c" produces "rec/Humor".
Inserting '\' will insert a backslash before any characters
that would be magic in a regular expression, including '%':
"%\C" produces "rec\.humor".
Inserting "'" will insert a backslash before any single-
quotes in the result, suitable for enclosing in single-
quotes and sending to a shell: "'%'s'" might produce
"'I'\''m a subject'".
Inserting ">" will strip out just the address portion of an
address string such as the From line.
Inserting ")" will strip out just the comment (real name)
portion of an address string such as the From line.
Inserting ":FMT" will format the result according to the
printf-style FMT string: "%:-50.50s" left-justifies the
subject into a 50 character field.
ENVIRONMENT
The following environment variables are paid attention to by
trn. In general the default values assumed for these
variables by trn are reasonable, so if you are using trn for
the first time, you can safely ignore this section. Note
that the defaults below may not correspond precisely to the
defaults on your system. To find the actual defaults you
would need to look in config.h and common.h in the trn
source directory, and the file INIT in the trn library
directory.
Those variables marked (%) are subject to % interpolation,
and those marked (~) are subject to both % interpolation and
~ interpretation.
ATTRIBUTION (%)
Gives the format of the attribution line in front of
the quoted article included by an F command.
Default: In article %i,%?%)f <%>f> wrote:
Page 37 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
AUTOSUBSCRIBE
When trn is checking for new newsgroups and finds
one matching one of the patterns in AUTOSUBSCRIBE,
the new group is automatically added to the end of
the .newsrc, subscribed. Newsgroups not matching
this or AUTOUNSUBSCRIBE, below, are offered to the
user.
AUTOSUBSCRIBE is a comma separated list of newsgroup
patterns ala 'o', '/', etc. It can also include
"but not" entries preceded by '!'. "a,b,!c,d" is
read as "matching a or b, unless it also matches c;
matching d regardless". Another way to look at it
is "(((a or b) and not c) or d)". To automatically
subscribe to all local groups but be choosy about
non-local groups, one might say "*,!*.*".
Default: (none)
AUTOUNSUBSCRIBE
AUTOUNSUBSCRIBE is very similar to AUTOSUBSCRIBE,
above, but new newsgroups matching it are
automatically added to the end of the .newsrc file,
unsubscribed. If a newsgroup matches AUTOSUBSCRIBE,
AUTOUNSUBSCRIBE is not consulted.
Default: (none)
CANCEL (~)
The shell command used to cancel an article.
Default: inews -h < %h
CANCELHEADER (%)
The format of the file to pass to the CANCEL command
in order to cancel an article.
Default:
Newsgroups: %n
Subject: cmsg cancel %i
References: %R
Reply-To: %L@%H (%N)
Distribution: %D
Organization: %o
%i cancelled from trn.
DOTDIR Where to find your dot files, if they aren't in your
home directory. Can be interpolated using "%.".
Default: $HOME
Page 38 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
EDITOR (~)
The name of your editor, if VISUAL is undefined.
Default: whatever your news administrator compiled
in, usually vi.
EXSAVER (%)
The shell command to execute in order to extract
data to either /bin/sh or a user-specified command.
Default: tail +%Bc %A | %e
FIRSTLINE (%)
Controls the format of the line displayed at the top
of an article. Warning: this may go away.
The default (ignoring the Marked to return display
in unthreaded groups) is approximately:
%C #%a%(%Z=^0$?%(%U!=^0$? (%U more\)): (%U + %v
more\))
FORWARDHEADER (%)
The format of the header file for forwarding
messages. See also FORWARDPOSTER.
Default:
To:
Subject: %(%i=^$?:[subject] (fwd\\)
%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}
)Newsgroups: %n
In-Reply-To: %i)
%(%[references]=^$?:References: %[references]
)Organization: %o
Cc:
Bcc: \n\n
FORWARDPOSTER (~)
The shell command to be used by the forward command
(^F) in order to allow you to edit and deliver the
file. trn will not itself call upon an editor for
replies -- this is a function of the program
referenced by FORWARDPOSTER. See also FORWARDHEADER
and MAILPOSTER.
Default: QUOTECHARS=%I Rnmail -h %h
HIDELINE
If defined, contains a regular expression which
matches article lines to be hidden, in order, for
instance, to suppress quoted material. A
Page 39 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
recommended string for this purpose is "^>...",
which doesn't hide lines with only '>', to give some
indication that quoted material is being skipped.
If you want to hide more than one pattern, you can
use "|" to separate the alternatives. You can view
the hidden lines by restarting the article with the
'v' command.
There is some overhead involved in matching each
line of the article against a regular expression.
You might wish to use a baud-rate modifier to enable
this feature only at low baud rates.
Default: undefined
HOME Your home directory. Affects ~ interpretation, and
the location of your dot files if DOTDIR is not
defined.
Default: $LOGDIR
KILLGLOBAL (~)
Where to find the KILL file to apply to every
newsgroup. See the '^K' command at the newsgroup-
selection level.
Default: %p/KILL
KILLLOCAL (~)
Where to find the KILL file for the current
newsgroup. See the commands 'K' and '^K' at the
article selection level, and the search modifier
'K'.
Default: %p/%c/KILL
LOGDIR Your home directory if HOME is undefined. Affects ~
interpretation, and the location of your dot files
if DOTDIR is not defined.
Default: none.
Explanation: you must have either $HOME or $LOGDIR.
LOGNAME Your login name, if USER is undefined. May be
interpolated using "%L".
Default: value of getlogin().
LOCALTIMEFMT
The format used by strftime() to print the local
time. The Date line is only displayed in local time
Page 40 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
if the group is threaded (see the -H option for more
information on Date).
Default: %a %b %e %X %Z %Y
which is the same format as the date(1) command.
MAILCALL (~)
What to say when there is new mail.
Default: (Mail)
MAILFILE (~)
Where to check for mail.
Default: /usr/spool/mail/%L
MAILHEADER (%)
The format of the header file for replies. See also
MAILPOSTER.
Default:
To: %t
Subject: %(%i=^$?:Re: %S
%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}
)Newsgroups: %n
In-Reply-To: %i)
%(%[references]=^$?:References: %[references]
)Organization: %o
Cc:
Bcc: \n\n
MAILPOSTER (~)
The shell command to be used by the reply commands
(r and R) in order to allow you to enter and deliver
the response. trn will not itself call upon an
editor for replies -- this is a function of the
program referenced by MAILPOSTER. See also
MAILHEADER.
Default: QUOTECHARS=%I Rnmail -h %h
MBOXSAVER (~)
The shell command to save an article in mailbox
format.
Default: %X/mbox.saver %A %P %c %a %B %C "%b" \
"From %t %`date`"
Explanation: the first seven arguments are the same
as for NORMSAVER. The eighth argument to the shell
Page 41 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
script is the new From line for the article,
including the posting date, derived either directly
from the Posted: line, or not-so-directly from the
Date: line. Header munging at its finest.
MODSTRING
The string to insert in the group summary line,
which heads each article, for a moderated group.
See also NOPOSTRING.
Default: " (moderated)"
NAME Your full name. May be interpolated using "%N".
Default: name from /etc/passwd, or ~/.fullname.
NEWSHEADER (%)
The format of the header file for follow-ups. See
also NEWSPOSTER.
Default:
%(%[followup-to]=^$?:X-ORIGINAL-NEWSGROUPS: %n
)Newsgroups: %(%F=^$?%C:%F)
Subject: %(%S=^$?%"\n\nSubject: ":Re: %S)
Summary:
Expires:
%(%R=^$?:References: %R
)Sender:
Followup-To:
%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}
)Distribution: %(%i=^$?%"Distribution: ":%D)
Organization: %o
Keywords: %[keywords]
Cc: \n\n
NEWSORG Either the name of your organization, or the name of
a file containing the name of your organization.
(For use at sites where the ORGANIZATION
environmental variable is already in use. NEWSORG
will override ORGANIZATION if both are present.)
May be interpolated using "%o".
Default: whatever your news administrator compiled
in.
NEWSPOSTER (~)
The shell command to be used by the follow-up
commands (f and F) in order to allow you to enter
and post a follow-up news article. trn will not
itself call upon an editor for follow-ups -- this is
a function of the program called by trn. See also
Page 42 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
NEWSHEADER.
Default: QUOTECHARS=%I Pnews -h %h
NNTPSERVER
The hostname of your NNTPSERVER. [This does not
apply unless you are running the NNTP version of
trn.]
Default: the hostname listed in the server file,
usually /usr/local/lib/rn/server.
NOPOSTRING
The string to insert in the group summary line,
which heads each article, for a group to which local
posting is not allowed. See also MODSTRING.
Default: " (no posting)"
NORMSAVER (~)
The shell command to save an article in the normal
(non-mailbox) format.
Default: %X/norm.saver %A %P %c %a %B %C "%b"
ORGANIZATION
Either the name of your organization, or the name of
a file containing the name of your organization.
(If NEWSORG is set, it will override ORGANIZATION.)
May be interpolated using "%o".
Default: whatever your news administrator compiled
in.
PAGESTOP
If defined, contains a regular expression which
matches article lines to be treated as form-feeds.
There are at least two things you might want to do
with this. To cause page breaks between articles in
a digest, you might define it as "^--------". To
force a page break before a signature, you could
define it as "^-- $". (Then, when you see "--" at
the bottom of the page, you can skip the signature
if you so desire by typing 'n' instead of space.)
To do both, you could use "^--". If you want to
break on more than one pattern, you can use "|" to
separate the alternatives.
There is some overhead involved in matching each
line of the article against a regular expression.
You might wish to use a baud-rate modifier to enable
this feature only at low baud rates.
Page 43 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
Default: undefined
PIPESAVER (%)
The shell command to execute in order to accomplish
a save to a pipe ("s | command" or "w | command").
The command typed by the user is substituted in as
%b.
Default: %(%B=^0$?<%A:tail +%Bc %A |) %b
Explanation: if %B is 0, the command is "<%A %b",
otherwise the command is "tail +%Bc %A | %b".
REPLYTO The value of the "Reply-To:" header, if needed.
RNINIT This variable is used when initializing trn in rn-
compatibility mode (see the -x switch) or when the
TRNINIT variable isn't defined. See the TRNINIT
variable for a description.
RNMACRO (~)
The name of the file containing macros and key
mappings when running trn as rn. See also the
TRNMACRO variable and the CUSTOM MACROS section.
Default: %./.rnmac
SAVEDIR (~)
The name of the directory to save to, if the save
command does not specify a directory name.
Default:
If -/ is set: %p/%c
If +/ is set: %p
SAVENAME (%)
The name of the file to save to, if the save command
contains only a directory name.
Default:
If -/ is set: %a
If +/ is set: %^C
SELECTCHARS
The characters used by the thread selector to select
the associated thread of discussion. You can
specify up to 64 visible characters, including
upper- and lower-case letters, numbers, and many
punctuation characters. Selection characters
override command characters in the selector, but are
not excluded from macro expansion, so be careful.
Page 44 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
Default: abdefgijlorstuvwxyz1234567890BCFGHIKMVW
(You'll notice various characters are omitted to
allow them to be typed as commands in the selector.)
SHELL The name of your preferred shell. It will be used
by the '!', 'S' and 'W' commands.
Default: whatever your news administrator compiled
in.
SUBJLINE (%)
Controls the format of the lines displayed by the
'=' command at the article selection level.
Default: %s
SUPERSEDEHEADER (%)
The format of the header file for a supersede
article.
Default:
From: %L@%H (%N)
Newsgroups: %n
Subject: %S
Distribution: %D
Organization: %o
Supersedes: %i
TERM Determines which termcap entry to use, unless
TERMCAP contains the entry.
TERMCAP Holds either the name of your termcap file, or a
termcap entry.
Default: /etc/termcap, normally.
TRNINIT Default values for switches may be passed to trn by
placing them in the TRNINIT variable (or RNINIT if
you're starting trn in rn-compatibility mode). Any
switch that is set in this way may be overruled on
the command line, or via the '&' command from within
trn. Binary-valued switches that are set with
"-switch" may be unset using "+switch".
If TRNINIT begins with a '/' it is assumed to be the
name of a file containing switches. You can put
comments in this file by preceding them with a '#'
as long as this is the first character on a line or
it follows some white-space (which delimits the
switches in the file). If you want to set many
environment variables but don't want to keep them
Page 45 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
all in your environment, or if the use of any of
these variables conflicts with other programs, you
can use this feature along with the -E switch to set
the environment variables upon startup.
Default: " ".
TRNMACRO (~)
The name of the file containing macros and key
mappings. If the file is not found, the RNMACRO
variable is used to look for your rn macros. For
information on what to put into this file, see the
CUSTOM MACROS section.
Default: %./.trnmac
UNSHAR (~)
The shell command to execute in order to accomplish
the unshar'ing of a shell archive.
Default: /bin/sh
USER Your login name. May be interpolated using "%L".
Default: $LOGNAME
VISUAL (~)
The name of your editor.
Default: $EDITOR
XTERMMOUSE
If you set this variable to 'y' (yes), trn will
enable the use of the xterm mouse in the selector if
you are using an xterm. If you set it to 'a'
(always), trn will assume you have an xterm. Once
enabled left-clicking on an item selects it while
middle-clicking an item will move to that item. If
you click the top (header) line of the selector it
moves up a page. If you click the bottom (footer)
line of the selector it executes the default command
for the page (left click) or goes down a page
(middle click). You can also use the right mouse
button to move up or down a page by clicking in the
upper-half or lower-half of the screen,
respectively.
YOUSAID (%)
Gives the format of the attribution line in front of
the quoted article included by an R command.
Default: In article %i you write:
Page 46 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
AUTOMATIC MACROS
On startup trn attempts to build a set of macros that map
your keypad arrow keys to useful functions. These default
actions are mentioned in the prior description of each
level's commands. If you don't like this (or trn gets it
wrong), you can disable the automatic macros by using the -A
option.
CUSTOM MACROS
When trn starts up it looks for a file containing macro
definitions (see environment variables TRNMACRO and
RNMACRO). Any sequence of commands may be bound to any
sequence of keys, so you could re-map your entire keyboard
if you desire. Blank lines or lines beginning with # in the
macro file are considered comments; otherwise trn looks for
two fields separated by white space. The first field gives
the sequence of keystrokes that trigger the macro, and the
second field gives the sequence of commands to execute.
Both fields are subject to % interpolation, which will also
translate backslash and caret sequences. (The keystroke
field is interpreted at startup time, but the command field
is interpreted at macro execution time so that you may refer
to % values in a macro.) For example, if you want to
reverse the roles of carriage return and space in trn
^J \040
^M \040
\040 ^J
will do just that. By default, all characters in the
command field are interpreted as the canonical trn
characters, i.e. no macro expansion is done. Otherwise the
above pair of macros would cause an infinite loop. To force
macro expansion in the command field, enclose the macro call
with ^( ... ^) thusly:
@s |mysavescript
@w w^(@s^)
You can use the %() conditional construct to construct
macros that work differently under different circumstances.
In particular, the current mode (%m) of trn could be used to
make a command that only works at a particular level. This
is particularly vital for the selector which uses most of
the lower-case letters to select the associated item in its
display. For example,
a %(%m=t?a:s art.hold\n)
will return the original letter (a) in the selector, and the
command "s art.hold\n" everywhere else.
Page 47 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
%(%{TERM}=vt100?^[[O) /^J
will do the binding only if the terminal type is vt100,
though if you have many of these it would be better to have
separate files for each terminal.
If you want to bind a macro to a function key that puts a
common garbage character after the sequence (such as the
carriage return on the end of Televideo 920 function
sequences), DO NOT put the carriage return into all the
sequences or you will waste a CONSIDERABLE amount of
internal storage. Instead of "^AF^M", put "^AF+1", which
indicates to trn that it should gobble up one character
after the F.
WHAT'S NEW
Here's a quick run-down of trn's features and commands aimed
at the knowledgeable rn or trn user.
The addition of true reference-line threading is one of the
biggest improvements over rn. This threading allows you to
read a discussion in reply order with an article's replies
being attached to the article that inspired them. Threads
will encompass multiple subjects whenever a reply to an
article in the thread arrives with a different subject.
This is usually done to better indicate the topic in the
reply when it diverges from the original subject.
Another big improvement is the selector, which is bound to
the '+' key. The selector displays a list of threads,
subjects, or individual articles to allow you to select the
topics that interest you by typing their associated letter.
The difference between the thread and the subject selector
is that the subject selector displays all subjects with a
separate selection letter, even those tied together via
their references. This can be quite useful if you select
some threads and desire to weed out some extraneous
discussions: you could switch the selector into exclusive
mode ('E' shows only selected threads) and then into subject
mode ('Ss') to separate the threads into their component
subjects and deselect or kill the subjects you don't care
about. You don't have to go to all this trouble using the
selector if you prefer to just hit the 'k' key when you
start reading a subject you're not interested in. The
selector can also switch between showing unread articles and
articles that have already been read, allowing you to
selectively re-read discussions (this is the 'U' command in
the selector).
Another threaded addition is the article-tree display in the
upper-right corner of the header. Looking at the tree gives
you a feel for how the articles you are reading relate to
Page 48 (printed 1/14/95)
TRN(1) UNIX System V (LOCAL) TRN(1)
each other, allowing you to see at a glance when there are
lots of replies and decide if you want to junk an
uninteresting set of replies or perhaps tough it out.
The header display has also been modified to hide a few more
lines by default (e.g. References), but, as always, you can
override these with -h. There is also some more "magic" in
the header: the From header can be trimmed to be just the
comment portion (if available), and the Date header is
displayed in local time (by default). Use -H and +H to turn
header magic on and off.
Once you begin reading articles, use the regular movement
commands (n, N, p, P, etc.) as you normally would. You'll
find that these commands track the reply order shown in the
tree display. Then try using ^N and ^P, which follow a
subject in the order the articles were posted. Finally,
check out the [, ], (, ), {, and } commands to move around
in the article tree a bit more directly. The first four
commands should also be bound to your keypad's arrow keys,
making them easier to type. For example, typing '[' (left)
takes you to your parent article, even if it was already
read, which is very useful for tracking down the cited
portion of the article in its original context.
There are additional kill commands for the entire thread (J)
and the current article and all its replies (,).
The KILL files have been extended and the commands inside
them are now referred to memorized commands, since they are
often used for}
Enable the extended (threaded) features of trn beyond
the rn compatibility mode (this may be the default on
your system, use +x if you yearn for the good ol'
days). The
to choose which thread selector
styles you like ('s'hort, 'm'edium, or 'l'ong), and in
what order they are selected with the 'L' command. For
example, use -xms to start with the medium display mode
and only switch between it and the short mode. You can
omit either or both of the parameters, in which case a
default of -x6lms is assumed.