Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site mirror.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!think!mirror!rs From: rs@mirror.UUCP Newsgroups: net.mail Subject: Re: Orphaned Response Message-ID: <6900005@mirror.UUCP> Date: Mon, 26-Aug-85 11:38:00 EDT Article-I.D.: mirror.6900005 Posted: Mon Aug 26 11:38:00 1985 Date-Received: Fri, 30-Aug-85 00:08:26 EDT References: <1342@rocksvax.UUCP> Lines: 139 Nf-ID: #R:rocksvax:-134200:mirror:6900005:177600:3478 Nf-From: mirror!rs Aug 26 11:38:00 1985 The following shar file contains two programs. The first is a /bin/sh script that reads an official DoD Internet table (in colon-syntax), and writes a pathalias-suitable list of all ARPA hosts. The official name, as well as the nicknames, are listed. (There might be a problem if a host has no nicknames, but the current hosttable (274, 8/21/85) has no such hosts.) The filter also ignores all the single-user machines it can find: I DON'T want somebody's office SUN in my tables! The second is a small word-wrapper for those people who don't have fmt. Enjoy! ------------------------------cut here------------------------ # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by mirror!rs on Mon Aug 26 11:33:30 EDT 1985 # Contents: filter ww.c echo x - filter sed 's/^XX//' > "filter" <<'@//E*O*F filter//' XX#! /bin/sh XX# A small script to read an offficial internet hosts file, and XX# put it into something that can be used with pathalias. XX# XX# The process is: XX# 1. Get all (not commented-out) host entries that aren't XX# single-user machines (an arbitrary list, I admit). XX# 2. Transliterate, strip off ARPA domain, and punt any XX# other domains. XX# 3. Sort, deleting multiple occurrences. XXT=/tmp/hosts$$ XXtrap 'exec rm -f $T Arpa.pathalias' 1 2 3 15 XXecho 'ARPA = {' >Arpa.pathalias XX grep -v '^;' hosts.txt |\ XX fgrep 'HOST' |\ XX awk -F: '\ XX$4 !~ /.*(ALTO|IMSAI|PC|SUN|SYMBOLICS|TRS).*/ { XX i = split($3, names, ",") XX for (j = 1; j <= i; j++) XX print names[j] XX}' |\ XX tr 'A-Z' 'a-z ' |\ XX sed -e 's/\.arpa//' -e '/.*\./d' -e 's/$/,/' | XX tr -d ' \010' |\ XX sort -u |\ XX fmt >>Arpa.pathalias XXrm -f $T XXexec echo ' VOID }' >>Arpa.pathalias @//E*O*F filter// chmod u=rwx,g=r,o=r filter echo x - ww.c sed 's/^XX//' > "ww.c" <<'@//E*O*F ww.c//' XX/* XX** WW XX** XX** Copy stdin to stdout, doing word-wrap so that no lines are longer XX** than a proscribed width. It doesn't expand tabs, but if you put XX** tabs in wrapped text, you deserve what you get! It also seems to XX** mess up sometimes. XX** XX** Written August 26, 1985 by Rich $alz at Mirror Systems (mirror!rs). XX*/ XX#include XX#define WIDTH 80 XXextern char *gets(); XXchar Ibuff[256]; XXchar Obuff[WIDTH + 1]; XXmain() XX{ XX register char *I; XX register char *O; XX register char *Ispace; XX register char *Ospace; XX register int C; XX for (C = 0, O = Ospace = Obuff; I = fgets(Ibuff, sizeof Ibuff, stdin); ) XX { XX if (*I == '\0') XX { XX *O = 0; XX (void)puts(Obuff); XX (void)putchar('\n'); XX C = 0; XX O = Obuff; XX continue; XX } XX for (I[strlen(I) - 1] = ' ', Ispace = I; *I; ) XX { XX while (C < WIDTH && *I) XX { XX *O++ = *I++; XX C++; XX if (*I == ' ') XX { XX Ospace = O; XX Ispace = I; XX } XX } XX if (C >= WIDTH) XX { XX if (Ospace == Obuff && *Obuff != ' ') XX Obuff[WIDTH] = '\0'; XX else XX { XX *Ospace = '\0'; XX if (*I) XX I = Ispace; XX } XX (void)puts(Obuff); XX C = 0; XX O = Ospace = Obuff; XX } XX } XX } XX *O = '\0'; XX (void)puts(Obuff); XX exit(0); XX} @//E*O*F ww.c// chmod u=rw,g=rw,o=rw ww.c exit 0 -- Rich $alz {mit-eddie, ihnp4!inmet, wjh12, cca, datacube} !mirror!rs Mirror Systems 2067 Massachusetts Ave. 617-661-0777 Cambridge, MA, 02140