Article View: news.software.readers
Article #60952Re: slrn multiple servers
From: John E. Davis
Date: Tue, 25 Apr 2000 00:00
Date: Tue, 25 Apr 2000 00:00
62 lines
2299 bytes
2299 bytes
On 25 Apr 2000 10:34:39 GMT, billy chan <bilchan@bigfoot.com>
wrote:
>Something I don't understand. How does slrn know which
>newsrc to map to if I merely define NEWS2? Will slrn simply use the
>second entry in the map if I define NEWS2? Thanks!
slrn uses the `server' commands to map servers to newsrc files. If
you set your NNTPSERVER environment varable to the server that you
want, then you can let slrn select the correct newsrc file using the
server command. Another user made a useful suggestion about using,
e.g.,
#v+
#if$NNTPSERVER news1.bigfoot.com
%news1 settings
#endif
#if$NNTPSERVER news2.bigfoot.com
%news2 settings
#endif
#v-
There are other possibilities as well. Here is one for those who like
macros. Put the line:
#v+
interpret "server.sl"
#v-
at the _top_ of your .slrnrc file. Then save the following to a file
called server.sl:
#v+
% server.sl
static variable servers =
["news1.bigfoot.com",
"news2.bigfoot.com",
"news3.bigfoot.com"];
static variable i, ch;
do
{
() = fprintf (stdout, "Available servers:\n\n");
for (i = 0; i < length (servers); i++)
() = fprintf (stdout, "%d. %s\n", i, servers[i]);
() = fprintf (stdout, "\nChoose server:");
() = fflush(stdout);
if (-1 == fgets (&ch, stdin))
ch = "0";
ch = strtrim (ch);
if (ch == "")
ch = "0";
ch = integer (ch);
}
while ((ch < 0) or (ch >= length (servers)));
putenv (strcat ("NNTPSERVER=", servers[ch]));
#v-
--John
Technical Details
Message-ID:
<slrn8gbv14.cio.davis@aluche.mit.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn8g3rt7.21o.kmoffat@halcyon.com> <956510227@bc.org> <slrn8g78vm.602.davis@aluche.mit.edu> <956649321@bc.org>Show Full Headers
Complete Article Headers
Message-ID: <slrn8gbv14.cio.davis@aluche.mit.edu> Subject: Re: slrn multiple servers Date: Tue, 25 Apr 2000 00:00:00 +0000 From: davis@space.mit.edu (John E. Davis) References: <slrn8g3rt7.21o.kmoffat@halcyon.com> <956510227@bc.org> <slrn8g78vm.602.davis@aluche.mit.edu> <956649321@bc.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 615602438 X-Trace: dreaderd 956693541 10968 18.75.2.45 Organization: Center for Space Research User-Agent: slrn/0.9.6.3 (Linux) Reply-To: davis@space.mit.edu Newsgroups: news.software.readers