[news.misc] Modifying header when saving articles

gary@cgdptah.ucar.edu (Gary Strand) (02/16/90)

  What I would like to do is save only a few lines from the header, in
  mailbox format. As an analogue, you can run 'rn' (what I'm using) with
  all header lines gone except those that you want to see, like this:

      rn -h +hfrom +hdate +hart +hlin +hfoll

  I only see 5 header lines, but the 'v'erbose command is always there if
  I need to see everything.

  I have modified several of the environment variables to my liking, but
  there doesn't appear to be an easy way to set up MBOXSAVER (or whatever)
  in a similar manner.

  Any suggestions, or am I just being dense?
--
Gary Strand                            "Wir lassen uns nicht mehr verarschen"
strandwg@ncar.ucar.edu                               -- banner at Berlin Wall

matthew@sunpix.East.Sun.COM ( Sun Visualization Products) (02/18/90)

In article <6320@ncar.ucar.edu> gary@cgdisis.ucar.edu (Gary Strand) writes:
>
>  What I would like to do is save only a few lines from the header, in
>  mailbox format. As an analogue, you can run 'rn' (what I'm using) with
>  all header lines gone except those that you want to see, like this:
>

    The problem is that rn calls the shell script mbox.saver by default,
and mbox.saver decides what gets saved.  

    I to wanted to customize the way articles get saved.  I ended up 
copying the shell script mbox.saver to my home directory. Modified it
to suit my tastes and then set up the enviromental variable MBOXSAVER
to point to it.


Here is the enviromental variable MBOXSAVER from my .login file:

}setenv  MBOXSAVER       '%~/.rnmbox %A %P %c %a %B %C "%b" "From %T %`date`"'

And here is the shell script '.rnmbox' I use to process the articles


}#! /bin/sh 
}# 
}# 
}#	Arguments:
}#	1 Full name of article (%A)
}#	2 Public news spool directory (%P)
}#	3 Directory of current newsgroup (%c)
}#	4 Article number (%a)
}#	5 Where in article to start (%B)
}#	6 Newsgroup name (%C)
}#	7 Save destination (%b)
}#	8 First line of message, normally From...
}#
}# 'case' statement used to force the path on moderated groups
}#
}export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
}
}  case $6 in
}	comp.binaries.amiga)
}		path='sun!swap!page';;
}	comp.sources.amiga)
}		path='sun!swap!page';;
}	comp.binaries.atari.st)
}		path='sun!grapevine!panarthea!koreth';;
}	comp.sources.atari.st)
}		path='sun!grapevine!panarthea!koreth';;
}	comp.binaries.ibm.pc)
}		path='sun!oliveb!cirrusl!dhesi';;
}	comp.binaries.mac)
}		path='zardoz!dhw68k!macintosh';;
}	comp.sources.games)
}		path='tektronix!tekgen!tekred!saab!billr';;
}	comp.sources.misc)
}		path='sun!practic!uunet!allbery';;
}	comp.sources.sun)
}		path='rti!mcnc!rutgers!mcgrew';;
}	comp.sources.unix)
}		path='rti!mcnc!gatech!bbn!rsalz';;
}	rec.humor.funny)
}		path='looking!funny-request';;
}	triangle.sun)
}		path='Sun-Spots-Digest';;
}	*)
}	 path=`echo "$8" | awk '{print $2}' | sed 's/sunpix!.*!uunet/uunet/'`;;
}  esac
}  echo "$path $8" | awk '{print $2, $1, $4, $5, $6, $7, $8, $9}' >> $7
}  sed '/^$/q' $1 | grep '^Subject:' >> $7
}  echo "Article $4 of $6:" >> $7
}  sed '/^$/q' $1 | egrep '(^Newsgroups: |^Subject: |^Summary: |^Reply-to: )' >> $7
}  echo ""  >> $7
}  sed '1,/^$/d' $1 | sed 's/^From/>From/' >> $7
}  echo ""  >> $7
-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |