v23i061: TRN, version of RN that follows conversation threads, Part02/14

Rich Salz rsalz at bbn.com
Sat Dec 1 08:40:06 AEST 1990


Submitted-by: Wayne Davison <davison at dri.com>
Posting-number: Volume 23, Issue 61
Archive-name: trn/part02

---- Cut Here and unpack ----
#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file trn.1 continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file trn.1"
sed 's/^X//' << 'SHAR_EOF' >> trn.1
Xadditional effect of marking the current article as read:
X.Sp
X    n N ^N e s S | w W
X.Sp
X.Sh "Miscellaneous facts about commands"
XAn \*(L'n\*(R' typed at either the \*(L"Last newsgroup\*(R" prompt or a
X\*(L"Last article\*(R" prompt will cycle back to the top of the newsgroup
Xor article list, whereas a \*(L'q\*(R' will quit the level.
X(Note that \*(L'n\*(R' does not mean \*(L"no\*(R", but rather
X\*(L"next\*(R".)
XA space will of course do whatever is shown as the
Xdefault, which will vary depending on whether
X.I trn
Xthinks you have more articles or newsgroups to read.
X.PP
XThe \*(L'b\*(R' (backup page) command may be repeated until the beginning of
Xthe article is reached.
XIf
X.I trn
Xis suspended (via a ^Z), then when the job is resumed, a refresh (^L) will
Xautomatically be done (Berkeley-type systems only).
XIf you type a command such as \*(L'!\*(R' or \*(L's\*(R' which takes you
Xfrom the middle of the article to the end, you can always get back into the
Xmiddle by typing \*(L'^L\*(R'.
X.PP
XIn multi-character commands such as \*(L'!\*(R', \*(L's\*(R', \*(L'/\*(R',
Xetc, you can interpolate various run-time values by typing escape and a
Xcharacter.
XTo find out what you can interpolate, type escape and \*(L'h\*(R', or check
Xout the single character % substitutions for environment variables in the
XInterpretation and Interpolation section, which are the same.
XAdditionally, typing a double escape will cause any % substitutions in the
Xstring already typed in to be expanded.
X.Sh "The Tree Display"
XWhen reading a threaded newsgroup,
X.I trn
Xdisplays a character representation of the article tree in the upper right
Xcorner of the header.
XFor example, consider the following display:
X.Sp
X.nf
X    (1)+-(1)--(\fI2\fP)--\fI[2]\fP
X       |-(1)+-[3]
X       |    \\-[1]
X       \\-(1)+-[1]--[1]
X            \\-[1]
X.fi
X.Sp
XThis tree represents an initial article that has three direct replies
X(the second column with three (1)'s).
XEach reply has further replies branching off from them.
XIn two cases the subject line was altered in the reply, as indicated
Xby the increasing numbers.
XWhen there is only one subject associated with a thread, all the nodes
Xare marked with the number 1.
XWhen the first subject change arrives, it is marked with the number 2,
Xand so on.
XIf you were to look at this thread in the thread selector, the three
Xsubjects associated with it would be listed in the same order as the
Xascending digits.
XIn those rare cases where more than 9 subjects are associated with each
Xthread, the nodes are marked with the letters A-Z, and then by a-z.
XThe articles that have already been read are enclosed in ()'s.
XUnread articles are displayed in []'s.
XThe currently displayed article has its entire node highlighted in the
Xdisplay.
XThe previously displayed article has only its number highlighted.
X.Sh "Options"
X.I Trn
Xhas a nice set of options to allow you to tailor the interaction
Xto your liking.
X(You might like to know that the author swears by
X\*(L"\-x6ls \-e \+m \-S -XX -N\*(R".)
XThese options may be set on the command line, via the RNINIT
Xenvironment variable, via a file pointed to by the RNINIT variable, or
Xfrom within
X.I trn
Xvia the & command.
XOptions may generally be unset by typing \*(L"+switch\*(R".
XOptions include:
X.TP 5
X.B \-a
Xturns on the alpha-numeric mode of the thread-selector.
XThis option has no affect unless
X.B \-x
Xis also specified (or is the default on your system).
X.TP 5
X.B \-c
Xchecks for news without reading news.
XIf a list of newsgroups is given on the command line, only those newsgroups
Xwill be checked; otherwise all subscribed-to newsgroups are checked.
XWhenever the
X.B \-c
Xswitch is specified, a non-zero exit status from
X.I trn
Xmeans that there is unread news in one of the checked newsgroups.
XThe
X.B \-c
Xswitch does not disable the printing of newsgroups with unread news;
Xthis is controlled by the
X.B \-s
Xswitch.
X(The
X.B \-c
Xswitch is not meaningful when given via the & command.)
X.TP 5
X.B \-C<number>
Xtells
X.I trn
Xhow often to checkpoint the
X.IR .newsrc ,
Xin articles read.
XActually, this number says when to start thinking about doing a checkpoint
Xif the situation is right.
XIf a reasonable checkpointing situation doesn't arise within 10 more
Xarticles, the
X.I .newsrc
Xis checkpointed willy-nilly.
X.TP 5
X.B \-d<directory name>
Xsets the default save directory to something other than ~/News.
XThe directory name will be globbed (via csh) if necessary (and if possible).
XArticles saved by
X.I trn
Xmay be placed in the save directory or in a subdirectory thereof depending
Xon the command that you give and the state of the environment variables
XSAVEDIR and SAVENAME.
XAny KILL files (see the K command in the Article Selection section)
Xalso reside in this directory and its subdirectories, by default.
XIn addition, shell escapes leave you in this directory.
X.TP 5
X.B \-D<flags>
Xenables debugging output.
XSee common.h for flag values.
XWarning: normally
X.I trn
Xattempts to restore your
X.I .newsrc
Xwhen an unexpected signal or internal error occurs.
XThis is disabled when any debugging flags are set.
X.TP 5
X.B \-e
Xcauses each page within an article to be started at the top of the screen,
Xnot just the first page.
X(It is similar to the
X.B \-c
Xswitch of
X.IR more (1).)
XYou never have to read scrolling text with this switch.
XThis is helpful especially at certain baud rates because you can start reading
Xthe top of the next page without waiting for the whole page to be printed.
XIt works nicely in conjuction with the
X.B \-m
Xswitch, especially if you use half-intensity for your highlight mode.
XSee also the
X.B \-L
Xswitch.
X.TP 5
X.B \-E<name>=<val>
Xsets the environment variable <name> to the value specified.
XWithin
X.IR trn ,
X\*(L"&\-ESAVENAME=%t\*(R" is similar to \*(L"setenv SAVENAME '%t'\*(R" in
X.IR csh ,
Xor \*(L"SAVENAME='%t'; export SAVENAME\*(R" in
X.IR sh .
XAny environment variables set with
X.B \-E
Xwill be inherited by subprocesses of
X.IR trn .
X.TP 5
X.B \-F<string>
Xsets the prefix string for the \*(L'F\*(R' followup command to use in
Xprefixing each line of the quoted article.
XFor example, \*(L"\-F<tab>\*(R" inserts a tab on the front of each line
X(which will cause long lines to wrap around, unfortunately),
X\*(L"\-F>>>>\*(R" inserts \*(L">>>>\*(R" on every line, and
X\*(L"\-F\*(R" by itself causes nothing to be inserted, in case you want to
Xreformat the text, for instance.
XThe initial default prefix is \*(L">\*(R".
X.TP 5
X.B \-g<line>
Xtells
X.I trn
Xwhich line of the screen you want searched-for strings to show up on when
Xyou search with the \*(L'g\*(R' command within an article.
XThe lines are numbered starting with 1.
XThe initial default is \*(L"\-g1\*(R", meaning the first line of the screen.
XSetting the line to less than 1 or more than the number of lines on the screen
Xwill set it to the last line of the screen.
X.TP 5
X.B \-h<string>
Xhides (disables the printing of) all header lines beginning with
X.I string.
XFor instance, \-hexp will disable the printing of the \*(L"Expires:\*(R" line.
XCase is insignificant.
XIf <string> is null, all header lines except Subject are hidden, and you
Xmay then use
X.B +h
Xto select those lines you want to see.
XYou may wish to use the baud-rate switch modifier below to hide more lines
Xat lower baud rates.
X.TP 5
X.B \-H<string>
Xworks just like
X.B \-h
Xexcept that instead of setting the hiding flag for a header line, it sets
Xthe magic flag for that header line.
XCertain header lines have magic behavior that can be controlled this way.
XAt present, the following actions are caused by the flag for the particular
Xline:
Xthe Newsgroups line will only print when there are multiple newsgroups;
Xthe Subject line will be underlined and (when threaded) the
Xkeyword \*(L'Subject:\*(R' is replaced by its subject number (e.g. [1]);
Xthe Expires line will always be suppressed if there is nothing on it;
Xthe name line is shortened to just the comment portion (the part
Xwithin parenthesis) if available; the date line is displayed in local
Xtime if the group is threaded.
XIn fact, all of these actions are the default, and you must use
X.B +H
Xto undo them.
X.TP 5
X.B \-i=<number>
Xspecifies how long (in lines) to consider the initial page of an
Xarticle\*(--normally this is determined automatically depending on baud rate.
X(Note that an entire article header will always be printed regardless of the
Xspecified initial page length.
XIf you are working at low baud rate and wish to reduce the size of the
Xheaders, you may hide certain header lines with the
X.B \(bsh
Xswitch.)
X.TP 5
X.B \-l
Xdisables the clearing of the screen at the beginning of each
Xarticle, in case you have a bizarre terminal.
X.TP 5
X.B \-L
Xtells
X.I trn
Xto leave information on the screen as long as possible by not blanking
Xthe screen between pages, and by using clear to end-of-line.
X(The
X.IR more (1)
Xprogram does this.)
XThis feature works only if you have the requisite termcap
Xcapabilities.
XThe switch has no effect unless the
X.B \-e
Xswitch is set.
X.TP 5
X.B \-m=<mode>
Xenables the marking of the last line of the previous page
Xprinted, to help the user see where to continue reading.
XThis is most helpful when less than a full page is going to be displayed.
XIt may also be used in conjunction with the
X.B \-e
Xswitch, in which case the page is erased, and the first line (which is
Xthe last line of the previous page) is highlighted.
XIf
X.B \-m=s
Xis specified, the standout mode will be used, but if
X.B \-m=u
Xis specified, underlining will be used.
XIf neither
X.B =s
Xor
X.B =u
Xis specified, standout is the default.
XUse
X.B +m
Xto disable highlighting.
X.TP 5
X.B \-M
Xforces mailbox format in creating new save files.
XOrdinarily you are asked which format you want.
X.TP 5
X.B \-N
Xforces normal (non-mailbox) format in creating new save files.
XOrdinarily you are asked which format you want.
X.TP 5
X.B \-q
Xbypasses the automatic check for new newsgroups when starting 
X.I trn.
X.TP 5
X.B \-r
Xcauses
X.I trn
Xto restart in the last newsgroup read during a previous session with
X.I trn.
XIt is equivalent to starting up normally and then getting to the newsgroup
Xwith a g command.
X.TP 5
X.B \-s
Xwith no argument suppresses the initial listing of newsgroups with unread
Xnews, whether
X.B \-c
Xis specified or not.
XThus
X.B \-c
Xand
X.B \-s
Xcan be used together to test \*(L"silently\*(R" the status of news from
Xwithin your
X.I .login
Xfile.
XIf
X.B \-s
Xis followed by a number, the initial listing is suppressed after that many
Xlines have been listed.
XPresuming that you have your
X.I .newsrc
Xsorted into order of interest,
X.B \-s5
Xwill tell you the 5 most interesting newsgroups that have unread news.
XThis is also a nice feature to use in your
X.I .login
Xfile, since it not only tells you whether there is unread news, but also how
Ximportant the unread news is, without having to wade through the entire
Xlist of unread newsgroups.
XIf no 
X.B \-s
Xswitch is given 
X.B \-s5
Xis assumed, so just putting \*(L"rn \-c\*(R"
Xinto your
X\&.login file is fine.
X.TP 5
X.B \-S<number>
Xcauses
X.I trn
Xto enter subject search mode (^N) automatically whenever an unthreaded
Xnewsgroup is
Xstarted up with <number> unread articles or more.
XAdditionally, it causes any \*(L'n\*(R' typed while in subject search mode
Xto be interpreted as \*(L'^N\*(R' instead.
X(To get back out of subject search mode, the best command is probably
X\&\*(L'^\*(R'.)
XIf <number> is omitted, 3 is assumed.
X.TP 5
X.B \-t
Xputs
X.I trn
Xinto terse mode.
XThis is more cryptic but useful for low baud rates.
X(Note that your system administrator may have compiled
X.I trn
Xwith either verbose or terse messages only to save memory.)
XYou may wish to use the baud-rate switch modifier below to enable terse mode
Xonly at lower baud rates.
X.TP 5
X.B \-T
Xallows you to type ahead of rn.
XOrdinarily rn will eat typeahead to prevent your autorepeating space bar from
Xdoing a very frustrating thing when you accidentally hold it down.
XIf you don't have a repeating space bar, or you are working at low baud
Xrate, you can set this switch to prevent this behavior.
XYou may wish to use the baud-rate switch modifier below to disable typeahead
Xonly at lower baud rates.
X.TP 5
X.B \-v
Xsets verification mode for commands.
XWhen set, the command being executed is displayed to give some feedback that
Xthe key has actually been typed.
XUseful when the system is heavily loaded and you give a command that takes
Xa while to start up.
X.TP 5
X.B \-x<number><list>
XEnable the extended (threaded) features of
X.I trn
Xbeyond the traditional
X.I rn
Xcompatibility mode.
X(This may be the default on your system, use +x if you yearn for the good
Xol' days.)
XThe <number> is the maximum number of article-tree lines (from 0 to 11)
Xyou want displayed in your header.
XUse the <list> to choose which thread selector modes you like (s \- short,
Xm \- medium, or l \- long), and in what order they are selected with the
X\&\*(L'L\*(R' command.
XFor example, use
X.B \-xls
Xto start with the long display mode and only switch between it and
Xthe short mode.
XYou can omit either or both of the parameters, in which case a default of
X.B \-x6lsm
Xis assumed.
X.TP 5
X.B \-X<number><commands>
XIf you like using the thread selector, you'll probably want to use this
Xoption to make the thread selector command (+) the default when a newsgroup
Xis started up with at least <number> unread articles.
X(Your installer may have chosen to make -X1 the default on your system.)
XIt is also used to select which commands you want to be the defaults while
Xusing the thread selector.
XFor example,
X.B \-X2XD
Xwill make the thread selector the default command for entering a newsgroup
Xwith at least 2 unread articles, and set the default command for the LAST
Xpage of the thread selector to be the
X.B X
Xcommand and the default command for all other pages to be the
X.B D
Xcommand.
XEither or both parameters can be omitted, as well as the second default
Xcommand (e.g.
X.B \-XX
Xwould change the default newsgroup entry to use the selector and the default
Xcommand for the last page of the selector to be \*(L'X\*(R').
XThe default is
X.B \-X1Z>
Xif just
X.B \-X
Xis specified.
XTo set the default selector commands without affecting the default entry
Xinto a newsgroup, specify a high number, like 9999.
X.TP 5
X.B \-/
Xsets SAVEDIR to \*(L"%p/%c\*(R" and SAVENAME to \*(L"%a\*(R", which means
Xthat by default articles are saved in a subdirectory of your private news
Xdirectory corresponding to the name of the the current newsgroup, with the
Xfilename being the article number.
X.B +/
Xsets SAVEDIR to \*(L"%p\*(R" and SAVENAME to \*(L"%^C\*(R", which by
Xdefault saves articles directly to your private news directory, with the
Xfilename being the name of the current newsgroup, first letter capitalized.
X(Either
X.B +/
Xor
X.B \-/
Xmay be default on your system, depending on the feelings of your news
Xadministrator when he, she or it installed
X.IR trn .)
XYou may, of course, explicitly set SAVEDIR and SAVENAME to other values\*(--see
Xdiscussion in the environment section.
X.PP
XAny switch may be selectively applied according to the current baud-rate.
XSimply prefix the switch with +speed to apply the switch at that speed or
Xgreater, and \%\-speed to apply the switch at that speed or less.
XExamples: \%\-1200\-hposted suppresses the Posted line at 1200 baud or less;
X\%+9600\-m enables marking at 9600 baud or more.
XYou can apply the modifier recursively to itself also: \%+300\-1200\-t sets
Xterse mode from 300 to 1200 baud.
X.PP
XSimilarly, switches may be selected based on terminal type:
X.Sp
X	\-=vt100+T		set +T on vt100
X.br
X	\-=tvi920\-ETERM=mytvi	get a special termcap entry
X.br
X	\-=tvi920\-ERNMACRO=%./.rnmac.tvi
X.br
X				set up special keymappings
X.br
X	+=paper\-v		set verify mode if not hardcopy
X.PP
XSome switch arguments, such as environment variable values, may require
Xspaces in them.
XSuch spaces should be quoted via ", ', or \e in the conventional fashion,
Xeven when passed via RNINIT or the & command.
X.Sh "Regular Expressions"
XThe patterns used in article searching are regular expressions such as
Xthose used by
X.IR ed (1).
XIn addition, \ew matches an alphanumeric character and \eW a nonalphanumeric.
XWord boundaries may be matched by \eb, and non-boundaries by \eB.
XThe bracketing construct \e(\ ...\ \e) may also be used, and \edigit matches
Xthe digit'th substring, where digit can range from 1 to 9.
X\e0 matches whatever the last bracket match matched.
XUp to 10 alternatives may given in a pattern, separated by \e|, with the
Xcaveat that \e(\ ...\ \e|\ ...\ \e) is illegal.
X.Sh "Interpretation and Interpolation"
XMany of the strings that
X.I trn
Xhandles are subject to interpretations of several types.
XUnder filename expansion, an initial \*(L"~/\*(R" is translated to the name
Xof your home directory, and \*(L"~name\*(R" is translated to the login
Xdirectory for the user specified.
XFilename expansion will also expand an initial environment variable, and
Xalso does the backslash, uparrow and percent expansion mentioned below.
X.PP
XAll interpreted strings go through backslash, uparrow and percent
Xinterpretation.
XThe backslash escapes are the normal ones (such as \en, \et, \ennn, etc.).
XThe uparrow escapes indicate control codes in the normal fashion.
XBackslashes or uparrows to be passed through should be escaped with backslash.
XThe special percent escapes are similar to printf percent escapes.
XThese cause the substitution of various run-time values into the string.
XThe following are currently recognized:
X.Ip %a 8
XCurrent article number.
X.Ip %A 8
XFull name of current article (%P/%c/%a).
X(On a Eunice system with the LINKART option, %P/%c/%a returns the name of
Xthe article in the current newsgroup, while %A returns the real name of
Xthe article, which may be different if the current article was posted to
Xmultiple newsgroups.)
X.Ip %b 8
XDestination of last save command, often a mailbox.
X.Ip %B 8
XThe byte offset to the beginning of the part of the article to be saved,
Xset by the save command.
XThe \*(L's\*(R' and \*(L'S\*(R' commands set it to 0, and the \*(L'w\*(R'
Xand \*(L'W\*(R' commands set it to the byte offset of the body of the article.
X.Ip %c 8
XCurrent newsgroup, directory form.
X.Ip %C 8
XCurrent newsgroup, dot form.
X.Ip %d 8
XFull name of newsgroup directory (%P/%c).
X.Ip %D 8
X\*(L"Distribution:\*(R" line from the current article.
X.Ip %e 8
XThe last command executed to extract data from an article.
X.Ip %E 8
XThe number of extra (unselected) articles, not counting the current article
Xif it is unselected.
X.Ip %f 8
X\*(L"From:\*(R" line from the current article, or the \*(L"Reply-To:\*(R"
Xline if there is one.
XThis differs from %t in that comments (such as the full name) are not
Xstripped out with %f.
X.Ip %F 8
X\*(L"Newsgroups:\*(R" line for a new article, constructed from
X\*(L"Newsgroups:\*(R" and \*(L"Followup-To:\*(R" lines of current article.
X.Ip %h 8
XName of the header file to pass to the mail or news poster,
Xcontaining all the information that the poster program needs in the
Xform of a message header.
XIt may also contain a copy of the current article.
XThe format of the header file is controlled by the MAILHEADER and NEWSHEADER
Xenvironment variables.
X.Ip %H 8
XHost name (your machine's name).
X.Ip %i 8
X\*(L"Message-I.D.:\*(R" line from the current article, with <> guaranteed.
X.Ip %I 8
XThe reference indication mark (see the
X.B \-F
Xswitch.)
X.Ip %l 8
XThe news administrator's login name, if any.
X.Ip %L 8
XLogin name (yours).
X.Ip %m 8
XThe current mode of
X.I trn,
Xfor use in conditional macros.
X.Sp
X.nf
X	i	Initializing.
X	n	Newsgroup selection level.
X	t	Thread selection level.
X	a	Article selection level (What next?).
X	p	Pager level (MORE prompt).
X	u	Set unread? prompt.
X	A	Add this newsgroup?
X	C	Catchup confirmation.
X	D	Delete bogus newsgroups?
X	M	Use mailbox format?
X	R	Resubscribe to this newsgroup?
X.fi
X.Sp
XNote that yes/no questions are all upper-case modes.
XIf, for example, you wanted to disallow defaults on all yes/no questions,
Xyou could define the following macro:
X.Sp
X.nf
X\e040	%(%m=[A-Z]?h: )
X.fi
X.Ip %M 8
XThe number of articles marked to return via the \*(L'M\*(R' command.
XIf the same article is Marked multiple times, \*(L"%M\*(R" counts it
Xmultiple times in the current implementation.
X.Ip %n 8
X\*(L"Newsgroups:\*(R" line from the current article.
X.Ip %N 8
XFull name (yours).
X.Ip %o 8
XOrganization (yours).
X.Ip %O 8
XOriginal working directory (where you ran rn from).
X.Ip %p 8
XYour private news directory, normally ~/News.
X.Ip %P 8
XPublic news spool directory, normally /usr/spool/news on systems that don't use NNTP.
X.Ip %r 8
XLast reference on references line of current article (parent article id).
X.Ip %R 8
XReferences list for a new article, constructed from the references and article
XID of the current article.
X.Ip %s 8
XSubject, with all Re's and (nf)'s stripped off.
X.Ip %S 8
XSubject, with one \*(L"Re:\*(R" stripped off.
X.Ip %t 8
X\*(L"To:\*(R" line derived from the \*(L"From:\*(R" and \*(L"Reply-To:\*(R"
Xlines of the current article.
XThis always returns an Internet format address.
X.Ip %T 8
X\*(L"To:\*(R" line derived from the \*(L"Path:\*(R" line of the
Xcurrent article to produce a uucp path.
X.Ip %u 8
XThe number of unread articles in the current newsgroup.
X.Ip %U 8
XThe number of unread articles in the current newsgroup, not counting the
Xthe current article.
XWhen threads are selected, this count reflects only selected articles.
X.Ip %x 8
XThe news library directory.
X.Ip %X 8
XThe rn library directory.
X.Ip %z 8
XThe length of the current article in bytes.
X.Ip %Z 8
XThe number of selected threads.
X.Ip %~ 8
XYour home directory.
X.Ip %. 8
XThe directory containing your dot files, which is your home directory unless
Xthe environment variable DOTDIR is defined when rn is invoked.
X.Ip %# 8
XA counter incremented during multiple-article commands.
XPrior to executing any such commands, it will return 0.
XDuring a multi-article command, it returns the current count starting from 1.
XAfterward, it retains its final value.
XFor example, the command
X.Sp
X	1003-1008 s my.%#
X.Sp
Xwould save articles 1003 through 1008 in the files my.1 through my.6.
X.Ip %$ 8
XCurrent process number.
X.Ip %/ 8
XLast search string.
X.Ip %% 8
XA percent sign.
X.Ip "%{name} or %{name\-default}" 8
XThe environment variable \*(L"name\*(R".
X.Ip %[name] 8
XThe value of header line \*(L"Name:\*(R" from the current article.
XThe \*(L"Name:\ \*(R" is not included.
XFor example \*(L"%D\*(R" and \*(L"%[distribution]\*(R" are equivalent.
XThe name must be spelled out in full.
X.Ip %`command` 8
XInserts the output of the command, with any embedded newlines translated
Xto space.
X.Ip %""prompt"" 8
XPrints prompt on the terminal, then inputs one string, and inserts it.
X.Ip "%(test_text=pattern?then_text:else_text)" 8
XIf
X.I test_text
Xmatches
X.IR pattern ,
Xhas the value
X.IR then_text ,
Xotherwise
X.IR else_text .
XThe \*(L":else_text\*(R" is optional, and if absent, interpolates the null string.
XThe = may be replaced with != to negate the test.
XTo quote any of the metacharacters
X(\*(L'=\*(R', \*(L'?\*(R', \*(L':\*(R', or \*(L')\*(R'),
Xprecede with a backslash.
X.Ip %digit 8
XThe digits 1 through 9 interpolate the string matched by the nth bracket
Xin the last pattern match that had brackets.
XIf the last pattern had alternatives, you may not know the number of the
Xbracket you want\*(--%0 will give you the last bracket matched.
X.PP
XModifiers: to capitalize the first letter, insert \*(L'^\*(R':
X\*(L"%^C\*(R" produces something like \*(L"Net.jokes\*(R".
XInserting \*(L'_\*(R' causes the first letter following the last
X\&\*(L'/\*(R' to be capitalized: \*(L"%_c\*(R" produces \*(L"net/Jokes\*(R".
X.SH ENVIRONMENT
XThe following environment variables are paid attention to by
X.IR trn .
XIn general the default values assumed for these variables by
X.I trn
Xare reasonable, so if you are using
X.I trn
Xfor the first time, you can safely ignore this section.
XNote that the defaults below may not correspond precisely to the defaults
Xon your system.
XTo find the actual defaults you would need to look in config.h and common.h
Xin the trn source directory, and the file INIT in the trn library.
X.PP
XThose variables marked (%) are subject to % interpolation, and those marked
X(~) are subject to both % interpolation and ~ interpretation.
X.Ip "ATTRIBUTION (%)" 8
XGives the format of the attribution line in front of the quoted article
Xincluded by an F command.
X.Sp
XDefault: In article %i %f writes:
X.Ip "CANCEL (~)" 8
XThe shell command used to cancel an article.
X.Sp
XDefault: inews \-h < %h
X.Ip "CANCELHEADER (%)" 8 13v
XThe format of the file to pass to the CANCEL command in order to cancel
Xan article.
X.Sp
XDefault:
X.br
XNewsgroups: %n
X.br
XSubject: cmsg cancel %i
X.br
XReferences: %R
X.br
XReply-To: %L@%H (%N)
X.br
XDistribution: %D
X.br
XOrganization: %o
X.sp 1
X%i cancelled from rn.
X.Ip DOTDIR 8
XWhere to find your dot files, if they aren't in your home directory.
XCan be interpolated using \*(L"%.\*(R".
X.Sp
XDefault: $HOME
X.Ip "EDITOR (~)" 8
XThe name of your editor, if VISUAL is undefined.
X.Sp
XDefault: whatever your news administrator compiled in, usually vi.
X.Ip "EXSAVER (%)" 8
XThe shell command to execute in order to extract data to either /bin/sh
Xor a user-specified command.
X.Sp
XDefault: tail +%Bc %A | %e
X.Ip "FIRSTLINE (%)" 8
XControls the format of the line displayed at the top of an article.
XWarning: this may go away.
X.Sp
XThe default in an unthreaded group is approximately:
X.Sp
XArticle %a %(%U%M!=^00$?(%U more%(%M!=^0$? + %M Marked to return)\e) )in %C:
X.Sp
XWhile the default in a threaded group is almost:
X.Sp
X%C #%a%(%Z=^0$?%(%U!=^0$? (%U more\e)): (%U + %E more\e))
X.Ip HIDELINE 8
XIf defined, contains a regular expression which matches article lines to
Xbe hidden, in order, for instance, to suppress quoted material.
XA recommended string for this purpose is \*(L"^>...\*(R", which \fIdoesn't\fR
Xhide lines with only \*(L'>\*(R', to give some indication that quoted
Xmaterial is being skipped.
XIf you want to hide more than one pattern, you can use \*(L"\||\|\*(R" to
Xseparate the alternatives.
XYou can view the hidden lines by restarting the article with the \*(L'v\*(R'
Xcommand.
X.Sp
XThere is some overhead involved in matching each line of the article against
Xa regular expression.
XYou might wish to use a baud-rate modifier to enable this feature only at
Xlow baud rates.
X.Sp
XDefault: undefined
X.Ip HOME 8
XYour home directory.
XAffects ~ interpretation, and the location of your
Xdot files if DOTDIR is not defined.
X.Sp
XDefault: $LOGDIR
X.Ip "KILLGLOBAL (~)" 8
XWhere to find the KILL file to apply to every newsgroup.
XSee the \*(L'^K\*(R' command at the newsgroup selection level.
X.Sp
XDefault: %p/KILL
X.Ip "KILLLOCAL (~)" 8
XWhere to find the KILL file for the current newsgroup.
XSee the commands \*(L'K\*(R' and \*(L'^K\*(R' at the article selection level,
Xand the search modifier \*(L'K\*(R'.
X.Sp
XDefault: %p/%c/KILL
X.Ip LOGDIR 8
XYour home directory if HOME is undefined.
XAffects ~ interpretation, and the location of your
Xdot files if DOTDIR is not defined.
X.Sp
XDefault: none.
X.Sp
XExplanation: you must have either $HOME or $LOGDIR.
X.Ip LOGNAME 8
XYour login name, if USER is undefined.
XMay be interpolated using \*(L"%L\*(R".
X.Sp
XDefault: value of getlogin().
X.Ip "MAILCALL (~)" 8
XWhat to say when there is new mail.
X.Sp
XDefault: (Mail)
X.Ip "MAILFILE (~)" 8
XWhere to check for mail.
X.Sp
XDefault: /usr/spool/mail/%L
X.Ip "MAILHEADER (%)" 8
XThe format of the header file for replies.
XSee also MAILPOSTER.
X.Sp
XDefault:
X.Sp
XTo: %T
X.br
XSubject: %(%i=^$?:Re: %S
X.br
XNewsgroups: %n
X.br
XIn-Reply-To: %i)
X.br
X%(%[references]!=^$?References\\: %[references]
X.br
X)Organization: %o
X.br
XCc: 
X.br
XBcc: \en\en
X.Ip "MAILPOSTER (~)" 8
XThe shell command to be used by the reply commands (r and R)
Xin order to allow you to enter and deliver the response.
X.I trn
Xwill not itself call upon an editor for replies\*(--this
Xis a function of the program called by
X.IR trn .
XSee also MAILHEADER.
X.Sp
XDefault: Rnmail \-h %h
X.Ip "MBOXSAVER (~)" 8
XThe shell command to save an article in mailbox format.
X.Sp
XDefault: %X/mbox.saver %A %P %c %a %B %C "%b" \e
X.br
X"From: %T %`date`"
X.Sp
XExplanation: the first seven arguments are the same as for NORMSAVER.
XThe eighth argument to the shell script is the new From: line
Xfor the article, including the posting date,
Xderived either directly from the Posted: line, or not-so-directly from
Xthe Date: line.
XHeader munging at its finest.
X.Ip MODSTRING 8
XThe string to insert in the group summary line, which heads each article,
Xfor a moderated group.  See also NOPOSTRING.
X.Sp
XDefault: " (moderated)"
X.Ip NAME 8
XYour full name.
XMay be interpolated using \*(L"%N\*(R".
X.Sp
XDefault: name from /etc/passwd, or ~/.fullname.
X.Ip "NEWSHEADER (%)" 8 16v
XThe format of the header file for followups.
XSee also NEWSPOSTER.
X.Sp
XDefault:
X.Sp
XNewsgroups: %(%F=^$?%C:%F)
X.br
XSubject: %(%S=^$?%"\en\enSubject: ":Re: %S)
X.br
XSummary:
X.br
XExpires: 
X.br
X%(%R=^$?:References: %R
X.br
X)Sender: 
X.br
XReply-To: %L@%H (%N)
X.br
XFollowup-To: 
X.br
XDistribution: %(%i=^$?%"\enDistribution: ":%D)
X.br
XOrganization: %o
X.br
XKeywords: \en\en
X.Ip "NEWSPOSTER (~)" 8
XThe shell command to be used by the followup commands (f and F)
Xin order to allow you to enter and post a followup news article.
X.I trn
Xwill not itself call upon an editor for followups\*(--this
Xis a function of the program called by
X.IR trn .
XSee also NEWSHEADER.
X.Sp
XDefault: Pnews \-h %h
X.Ip NOPOSTRING 8
XThe string to insert in the group summary line, which heads each article,
Xfor a group to which local posting is not allowed.  See also MODSTRING.
X.Sp
XDefault: " (no posting)"
X.Ip "NORMSAVER (~)" 8
XThe shell command to save an article in the normal (non-mailbox) format.
X.Sp
XDefault: %X/norm.saver %A %P %c %a %B %C "%b"
X.Ip ORGANIZATION 8
XEither the name of your organization, or the name of a file containing the
Xname of your organization.
XMay be interpolated using \*(L"%o\*(R".
X.Sp
XDefault: whatever your news administrator compiled in.
X.Ip PAGESTOP 8
XIf defined, contains a regular expression which matches article lines to
Xbe treated as form-feeds.
XThere are at least two things you might want to do with this.
XTo cause page breaks between articles in a digest, you might define it
Xas \*(L"^--------\*(R".
XTo force a page break before a signature, you could define it
Xas \*(L"^-- $\*(R".
X(Then, when you see \*(L"--\*(R" at the bottom of the page, you can skip
Xthe signature if you so desire by typing \*(L'n\*(R' instead of space.)
XTo do both, you could use \*(L"^--\*(R".
XIf you want to break on more than one pattern, you can use \*(L"\||\|\*(R" to
Xseparate the alternatives.
X.Sp
XThere is some overhead involved in matching each line of the article against
Xa regular expression.
XYou might wish to use a baud-rate modifier to enable this feature only at
Xlow baud rates.
X.Sp
XDefault: undefined
X.Ip "PIPESAVER (%)" 8
XThe shell command to execute in order to accomplish a save to a pipe
X(\*(L"s\ |\ command\*(R" or \*(L"w\ |\ command\*(R").
XThe command typed by the user is substituted in as %b.
X.Sp
XDefault: %(%B=^0$?<%A:tail +%Bc %A |) %b
X.Sp
XExplanation: if %B is 0, the command is \*(L"<%A %b\*(R", otherwise
Xthe command is \*(L"tail +%Bc %A | %b\*(R".
X.Ip RNINIT 8
XDefault values for switches may be passed to
X.I trn
Xby placing them in RNINIT.
XAny switch that is set in RNINIT may be overruled 
Xon the command line, or via the \*(L'&\*(R' command from within
X.IR trn .
XBinary-valued switches that are set with \*(L"\-switch\*(R" may be unset
Xusing \*(L"+switch\*(R".
X.Sp
XIf RNINIT begins with a \*(L'/\*(R' it is assumed to be the name of a file
Xcontaining switches.
XIf you want to set many environment variables but don't want to keep
Xthem all in your environment, or if the use of any of these variables
Xconflicts with other programs, you can use this feature along with the
X.B \-E
Xswitch to set the environment variables upon startup.
X.Sp
XDefault: \*(L" \*(R".
X.Ip "RNMACRO (~)" 8
XThe name of the file containing macros and key mappings.
XSee the MACROS section.
X.Sp
XDefault: %./.rnmac
X.Ip "SAVEDIR (~)" 8
XThe name of the directory to save to, if the save command does not specify
Xa directory name.
X.Sp
XDefault:
X.br
X   If
X.B \-/
Xis set: %p/%c
X.br
X   If
X.B +/
Xis set: %p
X.Ip "SAVENAME (%)" 8
XThe name of the file to save to, if the save command contains only a
Xdirectory name.
X.Sp
XDefault:
X.br
X   If
X.B \-/
Xis set: %a
X.br
X   If
X.B +/
Xis set: %^C
X.Ip "SELECTCHARS" 8
XThe characters used by the thread selector to select the associated thread
Xof discussion.
XYou can specify up to 64 visible characters, including upper- and lower-case
Xletters, numbers, and many punctuation characters.
XSelection characters override command characters in the selector, but are
Xnot excluded from macro expansion, so be careful.
X.br
XDefault: abcdefgijlorstuvwxz1234567890
X that can be typed
X.Ip SHELL 8
XThe name of your preferred shell.
XIt will be used by the \*(L'!\*(R', \*(L'S\*(R' and \*(L'W\*(R' commands.
X.Sp
XDefault: whatever your news administrator compiled in.
X.Ip "SUBJLINE (%)" 8
XControls the format of the lines displayed by the \*(L'=\*(R' command at
Xthe article selection level.
X.Sp
XDefault: %s
X.Ip TERM 8
XDetermines which termcap entry to use, unless TERMCAP contains the entry.
X.Ip TERMCAP 8
XHolds either the name of your termcap file, or a termcap entry.
X.Sp
XDefault: /etc/termcap, normally.
X.Ip "UNSHAR (~)" 8
XThe shell command to execute in order to accomplish the unshar'ing of a
Xshell archive.
X.Sp
XDefault: /bin/sh
X.Ip USER 8
XYour login name.
XMay be interpolated using \*(L"%L\*(R".
X.Sp
XDefault: $LOGNAME
X.Ip "VISUAL (~)" 8
XThe name of your editor.
X.Sp
XDefault: $EDITOR
X.Ip "YOUSAID (%)" 8
XGives the format of the attribution line in front of the quoted article
Xincluded by an R command.
X.Sp
XDefault: In article %i you write:
X.SH MACROS
XWhen
X.I trn
Xstarts up, it looks for a file containing macro definitions (see environment
Xvariable RNMACRO).
XAny sequence of commands may be bound to any sequence of keys, so you
Xcould remap your entire keyboard if you desire.
XBlank lines or lines beginning with # in the macro file are considered
Xcomments; otherwise
X.I trn
Xlooks for two fields separated by white space.
XThe first field gives the sequence of keystrokes that trigger the macro,
Xand the second field gives the sequence of commands to execute.
XBoth fields are subject to % interpolation, which will also translate
Xbackslash and uparrow sequences.
X(The keystroke field is interpreted at startup time, but the command field
Xis interpreted at macro execution time so that you may refer to % values
Xin a macro.)
XFor example, if you want to reverse the roles of carriage return and
Xspace in
X.I trn
X.Sp
X^J	\e040
X.br
X^M	\e040
X.br
X\e040	^J
X.Sp
Xwill do just that.
XBy default, all characters in the command field are interpreted as the
Xcanonical
X.I trn
Xcharacters, i.e. no macro expansion is done.
XOtherwise the above pair of macros would cause an infinite loop.
XTo force macro expansion in the command field, enclose the
Xmacro call with ^( ... ^) thusly:
X.Sp
X at s	|mysavescript
X.br
X at w	w^(@s^)
X.Sp
XYou can use the %() conditional construct to construct macros that work
Xdifferently under different circumstances.
XIn particular, the current mode (%m) of
X.I trn
Xcould be used to make a command that only works at a particular level.
XThis is particularly vital for the thread selector, which uses most of
Xthe lower-case letters to select the associated thread of discussion.
XFor example,
X.Sp
Xa	%(%m=t?a:s art.hold\en)
X.Sp
Xwill return the original letter (a) in the thread selector, and the command
X\*(L"s art.hold\en\*(R" everywhere else.
X.Sp
X%(%{TERM}=vt100?^[[O)	/^J
X.Sp
Xwill do the binding only if the terminal type is vt100,
Xthough if you have many of these it would be better to have separate
Xfiles for each terminal.
X.Sp
XIf you want to bind a macro to a function key that puts a common garbage character
Xafter the sequence (such as the carriage return on the end of Televideo 920
Xfunction sequences), DO NOT put the carriage return
Xinto all the sequences or you will waste a CONSIDERABLE amount of internal
Xstorage.
XInstead of \*(L"^AF^M\*(R", put \*(L"^AF+1\*(R", which indicates to
X.I trn
Xthat it should gobble up one character after the F.
X.SH "WHAT'S NEW?"
XHere's a quick run-down of
X.IR trn 's
Xnew features and commands aimed at the knowledgeable
X.I rn
Xuser.
X.Sp
XOne of the biggest improvements is the Thread Selector, which is bound
Xto the \*(L'+\*(R' key.
XThe selector displays a list of subject threads and (by default) authors
Xto allow you to select the topics that interest you by typing their
Xassociated letter.
XThe thread selector can also be used to browse articles that have already
Xbeen read, to selectively re-read discussions (use the \*(L'U\*(R' command).
X.Sp
XAnother big improvement is the thread-ordered display of articles.
XWhile reading each topic,
X.I trn
Xdisplays each article and its replies in the order of their parent/child
Xrelationship.
XThis lets you follow the flow of the discussion better, instead of jumping
Xaround from idea to idea or even reading a reply before the original article.
X.Sp
XAlong this same line is the addition of the article-tree display in the
Xupper-right corner of the header.
XGlancing at the tree gives you a better feel for how the articles you are
Xreading relate to each other.
X.Sp
XThe header has also been modified to hide a few more header-lines by default
X(e.g. References), but, as always, you can override these with \-h.
XThere is also some new \*(L"magic\*(R" in the header: the From header is
Xtrimmed to be just the comment portion (if available), and the Date header
Xis displayed in local time (in threaded groups).
XOverride these defaults with +H.
X.Sp
XOnce you begin reading articles, use the regular movement commands (n, N,
Xp, P, etc.) as you normally would.
XThen, check out the [, ], {, and } commands to move around in the article
Xtree a bit more directly.
XFor example, the \*(L'[\*(R' command takes you to your parent article,
Xeven if it was already read, whichp is very useful for tracking down the
Xcited portion of the article in its original context.
X.Sp
XThere are additional kill commands for the entire thread (J) and the
Xcurrent article and all its replies (,).
XThe KILL files have been extended to allow killing by thread (T), which will
Xkill a topic even if people fine-tune the subject along the way.
X.Sp
XThere is also an easy way to skip around in the various threads with
Xthe < and > commands.
X.Sp
XThere is a new command, \*(L"e dir\*(R", that extracts a shell archive or
Xuuencoded file into the specified directory.
XIt is even possible to extract other data formats if you specify the
Xappropriate filter command (e.g. \*(L"e dir|cmd\*(R".
X.Sp
XAlso, if you plan to use macro definitions, it is good to keep in mind
Xthat the thread selector uses most of the lower-case letters for thread
Xselection, and thus it is a good idea to explicitly set the mode(s) in
Xwhich a macro applies.
XFor example, if you want to press 'f' from the article pager/selector to
Xforward the current article to the user \*(L"smith\*(R", you could define:
X.Sp
X.nf
X	f	%(%m=[pa]?|mail smith\en:f)
X.fi
X.Sp
XThis checks the current mode (%m) and if it is \*(L'p\*(R' or \*(L'a\*(R'
Xit expands it to the string \*(L"|mail smith\en\*(R", otherwise it returns
Xthe letter \*(L'f\*(R'.
XIn some cases, you may simply wish to exclude the thread selector from a
Xmacro with the conditional \*(L"%m!=t\*(R".
X.Sp
XFinally, you'll probably want to use the new options,
X.B \-x
Xand
X.B \-X
Xto ensure that all the newest features are available for use.
XThese options might be on by default, depending on how your administrator
Xdecided to install
X.IR trn .
X.SH AUTHORS
XRn was created by Larry Wall <lwall at jpl-devvax.jpl.nasa.gov>
X.br
Xand is now under the direction of Stan Barber <sob at bcm.tmc.edu>.
X.br
XThreaded version by Wayne Davison <davison%drivax at uunet.uu.net>
X.br
X(Mail all bug reports for trn to Wayne.)
X.br
XRegular expression routines are borrowed from emacs, by James Gosling.
X.SH FILES
X.Ip "%./.newsrc" 1.25i
Xstatus of your news reading
X.Ip "%./.oldnewsrc" 1.25i
Xbackup copy of your
X.I .newsrc
Xfrom start of session
X.Ip "%./.rnlock" 1.25i
Xlock file so you don't screw up your
X.I .newsrc
X.Ip "%./.rnlast" 1.25i
Xinfo from last run of rn
X.Ip "%./.rnsoft" 1.25i
Xsoft pointers into /usr/lib/news/active to speed startup, synchronous with
X.I .newsrc
X.Ip "%./.rnhead" 1.25i
Xtemporary header file to pass to a mailer or news poster
X.Ip "%./.rnmac" 1.25i
Xmacro and keymap definitions
X.Ip "%p" 1.25i
Xyour news save directory, usually ~/News
X.Ip "%x/active" 1.25i
Xthe list of active newsgroups, usually /usr/lib/news/active on systems that don't use NNTP
X.Ip "%X/active2" 1.25i
Xthe list of active newsgroups when running in threaded mode.
X.Ip "%P" 1.25i
Xthe public news spool directory, usually /usr/spool/news on systems that don't use NNTP
X.Ip "%X/INIT" 1.25i
Xsystem-wide default switches
X.SH SEE ALSO
Xnewsrc(5), more(1), readnews(1), Pnews(1), Rnmail(1)
X.SH DIAGNOSTICS
XGenerally self-documenting, as they say.
X.SH BUGS
XThe
X.B \-h
Xswitch can only hide header lines that
X.I trn
Xknows about.
X.PP
XThe \*(L'\-\*(R' command doesn't cross newsgroup boundaries, and only undoes
Xthe last article selection.
X.PP
XIf you edit your
X.I .newsrc
Xwhile
X.I trn
Xis running,
X.I trn
Xwill happily wipe out your changes when it decides to
Xwrite out the
X.I .newsrc
Xfile.
X.PP
XMarking of duplicate articles as read in cross-referenced newsgroups will
Xnot work unless the Xref patch is installed in inews.
X.PP
XIf you get carried away with % or escape substitutions, you can overflow
Xbuffers.
X.PP
XThere should be no fixed limit on the number of newsgroups.
X.PP
XSome of the more esoteric features may be missing on machines with limited
Xaddress space.
SHAR_EOF
echo "File trn.1 is complete"
chmod 0660 trn.1 || echo "restore of trn.1 fails"
echo "x - extracting Configure (Text)"
sed 's/^X//' << 'SHAR_EOF' > Configure &&
X#!/bin/sh
X#
X# If these # comments don't work, trim them.  Don't worry about the other
X# shell scripts, Configure will trim # comments from them for you.
X#
X# $Header: Configure,v 4.3.3.1 90/07/24 21:56:31 davison Trn $
X#
X# $Log:	Configure,v $
X# Revision 4.3.3.1  90/07/24  21:56:31  davison
X# Initial Trn Release
X# 
X# Revision 4.3.2.25  90/05/12  17:34:53  sob
X# Still more XENIX fixes and fixes for using socketlib when rrn and not when
X# just rn.
X# 
X# Revision 4.3.2.24  90/05/12  14:07:43  sob
X# Fixed up LDFLAGS for xenix 286
X# 
X# Revision 4.3.2.23  90/05/04  00:42:31  sob
X# Fixes for Pyramids, more on the return value of signal() and
X# syncing up the use of socketlib.
X# 
X# Revision 4.3.2.22  90/04/17  15:44:24  sob
X# Added better directory structure detection.
X# 
X# Revision 4.3.2.21  90/04/14  19:36:38  sob
X# Added better support for the NeXT.
X# 
X# Revision 4.3.2.20  90/04/14  01:53:36  sob
X# Spelling Problem!
X# 
X# Revision 4.3.2.19  90/03/17  21:33:21  sob
X# Reworked VOIDSIG into SIGRET.
X# 
X# Revision 4.3.2.18  90/03/17  17:45:25  sob
X# Changes to detect when to use termio and when not to.
X# 
X# Revision 4.3.2.17  90/03/17  16:53:11  sob
X# Applied a patch to correctly determine being on a Sun running OS 4.0 or
X# later.
X# 
X# Revision 4.3.2.16  89/12/20  23:20:38  sob
X# Added hp-ux support suggested by tml at hemuli.atk.vtt.fi. Also,
X# corrected some bugs reported by tml at hemuli.atk.vtt.fi.
X# 
X# Revision 4.3.2.15  89/12/18  00:02:04  sob
X# Fixed bug reported by Jim Thompson <jthomp at sun.com> on the
X# use of ypmatch against the so-called services.byname YP map.
X# Sigh. Will YP EVER work?
X# 
X# Revision 4.3.2.14  89/12/17  12:55:39  sob
X# Minor bug fix to yp detection code.
X# 
X# Revision 4.3.2.13  89/12/17  01:53:21  sob
X# Changed from using ypcat to using ypmatch
X# 
X# Revision 4.3.2.12  89/12/15  19:35:20  sob
X# getpwent was not getting defined when YP is present.
X# bug reported by dglo at ads.com
X# 
X# Revision 4.3.2.11  89/12/13  00:42:59  sob
X# Included suggested patches by weening at gang-of-four.stanford.edu.
X# 
X# Revision 4.3.2.10  89/12/09  01:47:49  sob
X# Configure now removes myread when exiting.
X# 
X# Revision 4.3.2.9  89/12/08  22:41:14  sob
X# Added minor changes suggested by weening at Gang-of-Four.Stanford.EDU and
X# jik at pit-manager.mit.edu
X# 
X# Revision 4.3.2.8  89/11/28  00:30:06  sob
X# Attempted to make some of the references to the news software version
X# levels more clear for the benefit of novice news installers.
X# 
X# Revision 4.3.2.7  89/11/27  02:25:26  sob
X# Better detection of SunOS 4.0 and getpwent will be used on systems
X# that support YP, just in case.
X# 
X# Revision 4.3.2.6  89/11/27  01:32:56  sob
X# Added some changes suggested by various usenet postings.
X# Limited support for NeXT.
X# 
X# Revision 4.3.2.5  89/11/08  04:47:27  sob
X# Added VOIDSIG handling for SunOS 4.X
X# 
X# Revision 4.3.2.4  89/11/06  00:05:38  sob
X# Added RRN support originally distributed with NNTP 1.5
X# 
X# Revision 4.3.2.3  89/11/05  23:35:43  sob
X# Added checks for ultrix and sun
X#
X# Revision 4.3.1.6  86/07/24  14:41:18  lwall
X# Handles missing Relay-Version: from news 2.10.3 headers.
X#
X# Revision 4.3.1.5  85/05/23  11:23:22  lwall
X# filexp flubs sed command.
X# 
X# Revision 4.3.1.4  85/05/20  17:13:11  lwall
X# Makes sure -lcurses is really a terminfo library.
X# Puts single instead of double quotes around defs in config.sh.
X# 
X# Revision 4.3.1.3  85/05/16  16:48:48  lwall
X# Took space from end of filexp output.
X# 
X# Revision 4.3.1.2  85/05/13  15:54:35  lwall
X# Libraries in /usr/local/lib shouldn't use -l switch.
X# 
X# Revision 4.3.1.1  85/05/10  11:29:20  lwall
X# Branch for patches.
X# 
X# Revision 4.3  85/05/01  11:31:23  lwall
X# Baseline for release with 4.3bsd.
X# 
X
X# Yes, you may rip this off to use in other distribution packages.
X
Xn=''
Xc=''
Xlibc=''
Xeunicefix=''
Xeunice=''
Xcpp=''
Xshsharp=''
Xspitshell=''
Xstartsh=''
Xtest=''
Xexpr=''
Xsed=''
Xecho=''
Xcat=''
Xrm=''
Xmv=''
Xcp=''
Xtail=''
Xtr=''
Xmkdir=''
Xsort=''
Xuniq=''
Xinews=''
Xgrep=''
Xegrep=''
Xypmatch=''
Xcontains=''
Xlib=''
Xnametype=''
Xcc=''
Xiandd=''
Xinclude=''
Xrrninclude=''
Xtermlib=''
Xjobslib=''
Xndirlib=''
Xsocketlib=''
Xdirtype=''
Xdirinc=''
Xlibndir=''
Xusendir=''
Xndirc=''
Xndiro=''
Xpager=''
Xmailer=''
Xinternet=''
Xrnbin=''
Xfilexp=''
Xdistlist=''
XLog=''
XHeader=''
Xsitename=''
Xdomain=''
Xorgname=''
Xisadmin=''
Xnewsadmin=''
Xrnlib=''
Xmansrc=''
Xmanext=''
Xmaildir=''
Xspool=''
Xactive=''
Xmyactive=''
Xmininact=''
Xpref=''
Xdefeditor=''
Xrootid=''
Xmboxchar=''
Xlocpref=''
Xorgpref=''
Xcitypref=''
Xstatepref=''
Xcntrypref=''
Xcontpref=''
Xstrchr=''
Xmemcpy=''
Xrename=''
Xtruncate=''
Xchsize=''
Xsysptem=''
Xtzset=''
Xthreaddef=''
Xselectdef=''
Xthreaddir=''
Xnovoid=''
Xnovfork=''
Xportable=''
Xpassnam=''
Xberknam=''
Xusgnam=''
Xwhoami=''
Xtermio=''
Xfcntl=''
Xioctl=''
Xnormsig=''
Xsigblock=''
Xsigret=''
Xgetuidgid=''
Xgetcwd=''
Xhavetlib=''
Xgetpwent=''
Xgethostname=''
Xdouname=''
Xphostname=''
Xhostcmd=''
Xnorelay=''
Xisrrn=''
Xrdchk=''
Xserverfile=''
XNNTPSRC=''
XCONFIG=''
X
Xecho "Beginning of configuration questions for trn."
X: Eunice requires " " instead of "", can you believe it
Xecho " "
X
X: sanity checks
XPATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc'
Xexport PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
X
Xif test ! -t 0; then
X    echo "Type 'sh Configure', not 'sh <Configure'"
X    exit 1
Xfi
X
X: some greps do not return status, grrr.
Xecho "grimblepritz" >grimble
Xif grep blurfldyick grimble >/dev/null 2>&1 ; then
X    contains=contains
Xelse
X    if grep grimblepritz grimble >/dev/null 2>&1 ; then
X	contains=grep
X    else
X	contains=contains
X    fi
Xfi
X
X: the following should work in any shell
Xcase $contains in
Xcontains*)
X    echo " "
X    echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
X    cat >contains <<'EOSS'
Xgrep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
XEOSS
Xchmod 755 contains
Xesac
X
X: first determine how to suppress newline on echo command
Xecho "Checking echo to see how to suppress newlines..."
X(echo "hi there\c" ; echo " ") >.echotmp
Xif $contains c .echotmp >/dev/null 2>&1 ; then
X    echo "...using -n."
X    n='-n'
X    c=''
Xelse
X    echo "...using \\\c."
X    n=''
X    c='\c'
Xfi
Xecho $n "Type carriage return to continue.  Your cursor should be here-->$c"
Xread ans
Xrm .echotmp
X
X: now set up to do reads with possible shell escape
X: if this does not work on your machine, 1,$s/. myread/read ans/
Xcat <<EOSC >myread
Xans='!'
Xwhile expr "X\$ans" : "X!" >/dev/null; do
X    read ans
X    case "\$ans" in
X    !)
X	sh
X	echo " "
X	echo $n "Your answer: $c"
X	;;
X    !*)
X	set \`expr "X\$ans" : "X!\(.*\)\$"\`
X	sh -c "\$*"
X	echo " "
X	echo $n "Your answer: $c"
X	;;
X    esac
Xdone
XEOSC
X
X: general instructions
Xcat <<'EOH'
X 
XThis installation shell script will examine your system and ask you questions
Xto determine how trn and its auxiliary files should be installed.  If you
Xget stuck on a question, you may use a ! shell escape to start a subshell or
Xexecute a command.  Many of the questions will have default answers in
Xsquare brackets--typing carriage return will give you the default.
X
XOn some of the questions which ask for file or directory names you are
Xallowed to use the ~name construct to specify the login directory belonging
Xto "name", even if you don't have a shell which knows about that.  Questions
Xwhere this is allowed will be marked "(~name ok)".
X
XMuch effort has been expended to ensure that this shell script will run
Xon any Unix system.  If despite that it blows up on you, your best bet is to
Xedit Configure and run it again.  (Trying to install trn without having run
XConfigure is well nigh impossible.)  Also, tell Wayne (davison at drivax.UUCP)
Xhow he blew it.
X
XThis installation script affects things in two ways: 1) it does direct
Xvariable substitutions on some of the files included in this kit, and
X2) it builds a config.h file for inclusion in C programs.  You may edit
Xany of these files as the need arises after running this script.
X
XEOH
Xecho $n "[Type carriage return to continue] $c"
X. myread
X: get old answers, if there is a config file out there
Xif test -f config.sh; then
X    echo " "
X    echo "(Fetching default answers from your old config.sh file...)"
X    . config.sh
Xfi
X
X: get list of predefined functions in a handy place
Xecho " "
Xif test -f /lib/libc.a; then
X    echo "Your C library is in /lib/libc.a.  You're normal."
X    libc=/lib/libc.a
Xelse
X    if test -f /lib/Llibc.a; then
X	echo "Your C library is in /lib/Llibc.a.  I smell Xenix!"
X	libc=/lib/Llibc.a
X    else
X	if test -f /usr/lib/libc.a; then
X	    echo "Your C library is in /usr/lib/libc.a, of all places."
X	    libc=/usr/lib/libc.a
X	else
X	    if test -f "$libc"; then
X		echo "Your C library is in $libc, like you said before."
X	    else
X		cat <<'EOM'
X 
XI can't seem to find your C library.  I've looked for /lib/libc.a and
X/usr/lib/libc.a, but neither of those are there.  What is the full name
XEOM
X	    echo $n "of your C library? $c"
X	    . myread
X	    libc="$ans"
X	    fi
X	fi
X    fi
Xfi
Xecho " "
Xecho $n "Extracting names from $libc for later perusal...$c"
Xif ar t $libc > libc.list; then
X    echo "done"
Xelse
X    echo " "
X    echo "The archiver doesn't think $libc is a reasonable library."
X    exit 1
Xfi
X: make some quick guesses about what we are up against
Xecho " "
Xecho $n "Hmm...  $c"
Xif $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then
X    echo "Looks kind of like a BSD system, but we'll see..."
X    echo exit 0 >bsd
X    echo exit 1 >usg
X    echo exit 1 >v7
Xelse
X    if $contains SIGTSTP /usr/include/sys/signal.h >/dev/null 2>&1 ; then
X	echo "Looks sort of like a BSD system, but we'll see..."
X	echo exit 0 >bsd
X	echo exit 1 >usg
X	echo exit 1 >v7
X    else
X	if $contains fcntl.o libc.list >/dev/null 2>&1 ; then
X	    echo "Looks kind of like a USG system, but we'll see..."
X	    echo exit 1 >bsd
X	    echo exit 0 >usg
X	    echo exit 1 >v7
X	else
X	    echo "Looks kind of like a version 7 system, but we'll see..."
X	    echo exit 1 >bsd
X	    echo exit 1 >usg
X	    echo exit 0 >v7
X	fi
X    fi
Xfi
Xif $contains vmssystem.o libc.list >/dev/null 2>&1 ; then
X    cat <<'EOI'
XThere is, however, a strange, musty smell in the air that reminds me of
Xsomething...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
XEOI
X    echo "exit 0" >eunice
X    eunicefix=unixtovms
X    eunice=define
X: it so happens the Eunice I know will not run shell scripts in Unix format
Xelse
X    echo " "
X    echo "Congratulations.  You aren't running Eunice."
X    eunicefix=':'
X    eunice=undef
X    echo "exit 1" >eunice
Xfi
Xchmod 755 bsd usg v7 eunice
X$eunicefix bsd usg v7 eunice
X: see how we invoke the C preprocessor
Xecho " "
Xecho "Checking to see how your C preprocessor is invoked..."
Xcat <<'EOT' >testcpp.c
X#define ABC abc
X#define XYZ xyz
XABC+XYZ
XEOT
Xecho 'Maybe "cc -E" will work...'
Xcc -E testcpp.c >testcpp.out 2>&1
Xif $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
X    echo "Yup, it does."
X    cpp='cc -E'
Xelse
X    echo 'Nope...maybe "cc -P" will work...'
X    cc -P testcpp.c >testcpp.out 2>&1
X    if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
X	echo "Yup, that does."
X	cpp='cc -P'
X    else
X	echo 'Nixed again...maybe "/lib/cpp" will work...'
X	/lib/cpp testcpp.c >testcpp.out 2>&1
X	if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
X	    echo "Hooray, it works!  I was beginning to wonder."
X	    cpp='/lib/cpp'
X	else
X	    if $contains 'abc +xyz' testcpp.out >/dev/null 2>&1 ; then
X		echo "Found it!  You're on a NeXT, aren't you?"
X		cpp='/lib/cpp'
X	    else
X		echo 'Hmm...maybe you already told me...'
X		case "$cpp" in
X		'') ;;
X		*) $cpp testcpp.c >testcpp.out 2>&1;;
X		esac
X		if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
X		    echo "Hooray, you did!  I was beginning to wonder."
X		else
X		    echo "Nope. I can't find a C preprocessor.  Name one: $c"
X		    . myread
X		    cpp="$ans"
X		    $cpp testcpp.c >testcpp.out 2>&1
X		    if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
X			echo "OK, that will do."
X		    else
X			echo "Sorry, I can't get that to work.  Go find one."
X			exit 1
X		    fi
X		fi
X	    fi
X	fi
X    fi
Xfi
Xrm -f testcpp.c testcpp.out
X: check for pdp11
Xecho " "
Xcat <<'EOT' >pdp11.c
X#ifdef pdp11
Xexit 0
X#else
Xexit 1
X#endif
XEOT
X$cpp pdp11.c | grep exit >pdp11
Xchmod 755 pdp11
X$eunicefix pdp11
Xrm pdp11.c
Xif pdp11; then
X    echo "This looks like a pdp11 to me."
Xfi
X: check for ultrix
Xcat <<'EOT' >ultrix.c
X#ifdef ultrix
Xexit 0
X#else
Xexit 1
X#endif
XEOT
X$cpp ultrix.c | grep exit >ultrix
Xchmod 755 ultrix
X$eunicefix ultrix
Xrm ultrix.c
Xif ultrix; then
X    echo "Running ultrix, eh?"
Xfi
X
X: check for sun 4.0
Xcat <<'EOT' >sun.c
X#ifdef sun
Xexit 0
X#else
Xexit 1
X#endif
XEOT
X$cpp sun.c | grep exit >sun
Xchmod 755 sun
X$eunicefix sun
Xrm sun.c
Xif sun; then
X    echo "This looks like a sun to me."
X    if test -f /etc/ld.so.cache ; then
X	echo "And it appears you are running SunOS 4.0 or greater."
X    fi
Xfi
X: check for hp-ux
Xcat <<'EOT' >hp-ux.c
X#ifdef hpux
Xexit 0
X#else
Xexit 1
X#endif
XEOT
X$cpp hp-ux.c | grep exit >hp-ux
Xchmod 755 hp-ux
X$eunicefix hp-ux
Xrm hp-ux.c
Xif hp-ux; then
X    echo "Hewlett-Packard must have built this..."
X    socketlib=-lbsdipc
Xfi
X
X: check for sgi
Xcat <<'EOT' >sgi.c
X#ifdef sgi
Xexit 0
X#else
Xexit 1
X#endif
XEOT
X$cpp sgi.c | grep exit >sgi
Xchmod 755 sgi
X$eunicefix sgi
Xrm sgi.c
Xif sgi; then
X    echo "Silicon Graphics must have built this..."
X	include=-I/usr/include/bsd
X	rrninclude="-I/usr/include/bsd -DUSG"
X	socketlib=-lbsd
Xfi
X
X: check for XENIX
Xcat <<'EOT' >xenix
Xtest -f /xenix; exit $?
XEOT
Xchmod 755 xenix
X$eunicefix xenix
Xif xenix; then
X    echo "Kinda looks like XENIX....hmmm"
X	rrninclude="-DUSG -DLAI_TCP"
X	socketlib=-lsocket
X	sigret=void
X	rdchk=define
X	dirtype=dirent
Xelse
X	rdchk=undef
Xfi
X
X: check for Pyramid OSx
Xcat <<'EOT' >pyr.c
X#ifdef pyr
Xexit 0
X#else
Xexit 1
X#endif
XEOT
X$cpp pyr.c | grep exit >pyr
Xchmod 755 pyr
X$eunicefix pyr
Xrm pyr.c
Xif pyr; then
X    echo "This looks like a Pyramid to me."
Xfi
X
Xif bsd; then
X    getuidgid=define
Xelse
X    getuidgid=undef
Xfi
X
X: see if sh knows # comments
Xecho " "
Xecho "Checking your sh to see if it knows about # comments..."
Xif sh -c '#' >/dev/null 2>&1 ; then
X    echo "Your sh handles # comments correctly."
X    shsharp=true
X    spitshell=cat
X    echo " "
X    echo "Okay, let's see if #! works on this system..."
X    echo "#!/bin/echo hi" > try
X    $eunicefix try
X    chmod 755 try
X    try > today
X    if test -s today; then
X	echo "It does."
X	sharpbang='#!'
X    else
X	echo "#! /bin/echo hi" > try
X	$eunicefix try
X	chmod 755 try
X	try > today
X	if test -s today; then
X	    echo "It does."
X	    sharpbang='#! '
X	else
X	    echo "It doesn't."
X	    sharpbang=': use '
X	fi
X    fi
Xelse
X    echo "Your sh doesn't grok # comments--I will strip them later on."
X    shsharp=false
X    echo "exec grep -v '^#'" >spitshell
X    chmod 755 spitshell
X    $eunicefix spitshell
X    spitshell=`pwd`/spitshell
X    echo "I presume that if # doesn't work, #! won't work either!"
X    sharpbang=': use '
Xfi
X
X: figure out how to guarantee sh startup
Xecho " "
Xecho "Checking out how to guarantee sh startup..."
Xstartsh=$sharpbang'/bin/sh'
Xecho "Let's see if '$startsh' works..."
Xcat >try <<EOSS
X$startsh
Xset abc
Xtest "$?abc" != 1
XEOSS
X
Xchmod 755 try
X$eunicefix try
Xif try; then
X    echo "Yup, it does."
Xelse
X    echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
Xfi
Xrm -f try today
X
X: find out where common programs are
Xecho " "
Xecho "Locating common programs..."
Xpth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /usr/etc /usr/5bin"
Xcat <<EOSC >loc
X$startsh
Xthing=\$1
Xshift
Xdflt=\$1
Xshift
Xfor dir in \$*; do
X    case "\$thing" in
X    .)
X	if test -d \$dir/\$thing; then
X	    echo \$dir
X	    exit 0
X	fi
X	;;
X    *)
X	if test -f \$dir/\$thing; then
X	    echo \$dir/\$thing
X	    exit 0
X	fi
X	;;
X    esac
Xdone
Xecho \$dflt
Xexit 1
XEOSC
Xchmod 755 loc
X$eunicefix loc
Xloclist="expr sed echo cat rm mv cp tail tr mkdir sort uniq grep"
SHAR_EOF
echo "End of part 2"
echo "File Configure is continued in part 3"
echo "3" > s2_seq_.tmp
exit 0
-- 
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.



More information about the Comp.sources.unix mailing list