Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!uunet!wuarchive!texbell!vector!chip From: chip@vector.Dallas.TX.US (Chip Rosenthal) Newsgroups: news.software.b Subject: Re: rn macros (long) Message-ID: <713@vector.Dallas.TX.US> Date: 28 Aug 89 01:43:32 GMT References: <454404fd.1766d@june.engin.umich.edu> Reply-To: chip@vector.Dallas.TX.US (Chip Rosenthal) Organization: Dallas Semiconductor Lines: 58 lwk@caen.engin.umich.edu (Woody Kellum) writes: >#If you have a problem saving messages to: ># ~/News/comp.unix.questions >#because of a 14 character filename limit, save them to: ># ~/News/Comp/unix.questions >#Do this by placing: >-ESAVENAME="%`%X/savename %^C`" >#in $LIBDIR/rn/INIT, and my $LIBDIR/rn/savename script says: > {{{ deleted savename script }}} >#Chip Rosenthal / chip@vector.Dallas.TX.US The reason I used the the %X/savename script was because I couldn't get the quoting quite right to generate SAVENAME directly. I since have, and now use: SAVENAME="%\`echo %^C | sed -e 's/\\\\./\\\\//'\`" As long as we are talking favorite rn hacks, I think it's a problem that rn has per-user macro files, but only a global system initialization file. Well...I fixed that recently. I moved the "rn" executable to LIBDIR/rn, and instead place the following script in BINDIR: : INIT=$HOME/.rninit RN=/usenet/lib/news/rn/rn PROTO=/usenet/lib/news/rn/rninit-proto if [ ! -f $INIT ] ; then echo "$0: creating an '$INIT' startup initializations file" 1>&2 cp $PROTO $INIT fi . $INIT exec $RN $@ echo "$0: couldn't exec rn" 1>&2 exit 1 This allows you to setup a "$HOME/.rninit" file with all your environment initializations without polluting your environment outside of "rn". For example, my .rninit file says: AUTHORCOPY="$HOME/News/NewsCC" MAILRECORD="$HOME/News/MailCC" RNINIT="-v -S -hmessage-id -hreferences -hreply-to -hdate -hfollowup-to" KILLGLOBAL="%p/Killfiles/KILL" KILLLOCAL="%p/Killfiles/%c/KILL" SAVEDIR="%p/Savefiles" SAVENAME="%\`echo %C | sed -e 's/\\\\./\\\\//'\`" export AUTHORCOPY MAILRECORD RNINIT KILLGLOBAL KILLLOCAL SAVEDIR SAVENAME The problem with this approach is that there are things run outside of "rn" which need some of these initializations, e.g. Pnews needs "AUTHORCOPY". I've cheated and kept those things in my login shell environment, but at some point plan on hacking Pnews.SH and such to understand $HOME/.rninit. -- Chip Rosenthal / chip@vector.Dallas.TX.US / Dallas Semiconductor / 214-450-5337 "I wish you'd put that starvation box down and go to bed" - Albert Collins' Mom