Thread View: news.software.nn
3 messages
3 total messages
Started by Maarten Litmaath
Fri, 01 Jun 1990 00:59
alternative nn-aux script + macros, version 4.3 (nn6.4, nn6.3)
Author: Maarten Litmaath
Date: Fri, 01 Jun 1990 00:59
Date: Fri, 01 Jun 1990 00:59
357 lines
9123 bytes
9123 bytes
Remember to configure `nn-aux'!
--------------------cut here--------------------
define 0
'!'"nn-aux -f $A"
end
define 1
'!'"nn-aux -r $A"
end
define 2
'!'"nn-aux -c $A"
end
define 3
'!'"nn-aux -m $A"
end
define 4
'!'"nn-aux -p $A"
end
map show f macro 0 # followup
map show r macro 1 # reply
map show C macro 2 # cancel
map show m macro 3 # mail (forward)
map show & macro 4 # post
--------------------cut here--------------------
: This is a shar archive. Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'nn-aux'
sed 's/^X//' > 'nn-aux' << '+ END-OF-FILE ''nn-aux'
X#!/bin/sh
X# @(#)nn-aux 4.3 90/06/01 Maarten Litmaath
X# to be configured: INEWS, SENDMAIL, POSTLOGFILE, MAILLOGFILE, ORGANIZATION,
X# Distributions, mailbox format, IGNORE and the environment variable QUOTE
X
XINEWS=/usr/local/bin/inews
XSENDMAIL='/usr/lib/sendmail -t'
XPOSTLOGFILE=${POSTLOGFILE-$HOME/.nn/posted}
XMAILLOGFILE=${MAILLOGFILE-$HOME/.nn/mailed}
XORGANIZATION=${ORGANIZATION-'n., the process of becoming an organ'}
X
XPATH=/bin:/usr/bin:/usr/ucb:$PATH
X
XOPTIONS=cfmpr
X
Xexpr $# = 2 \& x"$1" : x"-[$OPTIONS]\$" > /dev/null || {
X echo "Usage: `basename $0` -[$OPTIONS] <path-to-article>" >&2
X exit 2
X}
X
XOP=`expr "$1" : '-\\(.*\\)'`
XA=$2
Xop_c=cancel
Xop_f=followup
Xop_m=mail
Xop_p=post
Xop_r=reply
Xeval OPERATION=\$op_$OP
Xecho $OPERATION >&2
X
X# handle cancel request
X
X[ $OP = c ] && {
X NEWSGROUPS=`
X sed -n -e '/^Newsgroups: /{' -e 's///' -e p -e q -e '}' "$A"
X `
X IDENT=`sed -n -e '/^Message-ID: /{' -e 's///' -e p -e q -e '}' "$A"`
X DISTRIBUTION=`
X sed -n -e '/^$/q' -e '/^Distribution: /{' -e 's///' \
X -e p -e q -e '}' "$A"
X `
X test x"$DISTRIBUTION" = x && DISTRIBUTION=world
X SUBJECT=`sed -n -e '/^Subject: /{' -e p -e q -e '}' "$A"`
X echo "Article: $IDENT"
X echo "$SUBJECT"
X echo "Newsgroups: $NEWSGROUPS"
X echo -n "Confirm cancel: [ny] "
X read ans
X test x"$ans" = xy && {
X echo "Newsgroups: $NEWSGROUPS"
X echo "Subject: cmsg cancel $IDENT"
X echo "Control: cancel $IDENT"
X echo "Distribution: $DISTRIBUTION"
X echo ""
X } | $INEWS -h
X exit
X}
X
XWORK=$HOME/nn$$
XTRACE=${WORK}T
Xumask 077
X
XUSER=`whoami`
Xexport USER # to supply inews etc. with a correct USER string :-(
XGECOS=`
X cat $HOME/.fullname 2> /dev/null || (
X ypmatch $USER passwd 2> /dev/null || grep $USER /etc/passwd
X ) | awk -F: '{ print $5 }' | sed 's/,.*//'
X`
X
Xcase $OP in
Xf|r)
X SUBJECT=`
X sed -n -e '/^Subject: /{' -e 's///' -e 's/^Re: //' -e \
X 's/^/Re: /' -e p -e q -e '}' "$A"
X `
X IDENT=`sed -n -e '/^Message-ID: /{' -e 's///' -e p -e q -e '}' "$A"`
X REFERENCES=`
X sed -n -e '/^$/q' -e '/^References:/{' -e 's///' \
X -e p -e q -e '}' "$A"
X `
X if [ -z "$QUOTE" ]; then
X QUOTE='> '
X else
X QUOTE=`echo "$QUOTE" | sed 's-[/\\\\&]-\\\\&-g'`
X fi
Xesac
X
Xcase $OP in
Xf)
X ORIGFROM=`sed -n -e '/^From: /{' -e 's///' -e p -e q -e '}' "$A"`
X FOLLOWUP=`
X sed -n -e '/^$/q' -e '/^Followup-To: /{' -e 's///' \
X -e p -e q -e '}' "$A"
X `
X if [ -z "$FOLLOWUP" ]; then
X NEWSGROUPS=`
X sed -n -e '/^Newsgroups: /{' -e 's///' \
X -e p -e q -e '}' "$A"
X `
X else
X [ x"$FOLLOWUP" = xposter ] &&
X echo 'Followups are directed to the poster!' > /dev/tty
X NEWSGROUPS=$FOLLOWUP
X fi
X DISTRIBUTION=`
X sed -n -e '/^$/q' -e '/^Distribution: /{' -e 's///' \
X -e p -e q -e '}' "$A"
X `
X test x"$DISTRIBUTION" = x && DISTRIBUTION=world
X # no `From:' line, else inews will act `funny' :-(
X echo "Newsgroups: $NEWSGROUPS"
X echo "Subject: $SUBJECT"
X echo "Summary: "
X echo "Expires: "
X echo "References:$REFERENCES $IDENT"
X echo "Reply-To: $USER@`domainname` ($GECOS)"
X echo "Followup-To: $FOLLOWUP"
X echo "Distribution: $DISTRIBUTION"
X echo "Organization: $ORGANIZATION"
X echo "Keywords: "
X echo ''
X echo "In article $IDENT,"
X echo " $ORIGFROM writes:"
X sed -e '1,/^$/d' -e "s/^/$QUOTE/" "$A"
X ;;
Xm)
X FROM="$GECOS <$USER@`domainname`>"
X SUBJECT=`
X sed -n -e '/^Subject: /{' -e 's//[Forwarded] /' \
X -e p -e q -e '}' "$A"
X `
X NEWSGROUPS=`sed -n -e '/^Newsgroups: /{' -e p -e q -e '}' "$A"`
X echo "To: "
X echo "From: $FROM"
X echo "Subject: $SUBJECT"
X echo "$NEWSGROUPS"
X echo "Organization: $ORGANIZATION"
X echo "Cc:"
X echo "Bcc:"
X echo ''
X cat "$A"
X ;;
Xr)
X TO=`
X sed -n -e '/^$/q' -e '/^Reply-To: /{' -e 's///' \
X -e p -e q -e '}' "$A"
X `
X ORIG_FROM=`sed -n -e '/^From: /{' -e 's///' -e p -e q -e '}' "$A"`
X ORIG_PATH=`sed -n -e '/^Path: /{' -e 's///' -e p -e q -e '}' "$A"`
X [ -z "$TO" ] && TO="$ORIG_FROM"
X FROM="$GECOS <$USER@`domainname`>"
X NEWSGROUPS=`sed -n -e '/^Newsgroups: /{' -e p -e q -e '}' "$A"`
X
X echo "To: $TO"
X echo "Orig-From: $ORIG_FROM"
X echo "Orig-Path: $ORIG_PATH"
X echo "From: $FROM"
X echo "Subject: $SUBJECT"
X echo "$NEWSGROUPS"
X echo "In-Reply-To: $IDENT"
X echo "References:$REFERENCES"
X echo "Organization: $ORGANIZATION"
X echo "Cc: "
X echo "Bcc: "
X echo ''
X echo "In article $IDENT you write:"
X sed -e '1,/^$/d' -e "s/^/$QUOTE/" "$A"
X ;;
Xp)
X NEWSGROUPS=`sed -n -e '/^Newsgroups: /{' -e s/// -e p -e q -e '}' "$A"`
X FOLLOWUP=`echo "$NEWSGROUPS" | sed 's/net\\.general/net.followup/g'`
X
X MENU='Distributions:
X
Xl - local
Xn - nlnet
Xe - eunet
Xw - world
X
XSelect: '
X dist_l=local
X dist_n=nlnet
X dist_e=eunet
X dist_w=world
X
X while
X echo -n "$MENU" > /dev/tty
X read dist
X do
X case $dist in
X [lnew])
X eval DISTRIBUTION=\$dist_$dist
X break
X esac
X echo "Unknown command \`$dist'" > /dev/tty
X done
X
X echo "Newsgroups: $NEWSGROUPS"
X echo "Subject: "
X echo "Summary: "
X echo "Expires: "
X echo "Reply-To: $USER@`domainname` ($GECOS)"
X echo "Followup-To: $FOLLOWUP"
X echo "Distribution: $DISTRIBUTION"
X echo "Organization: $ORGANIZATION"
X echo "Keywords: "
X echo ''
Xesac > $WORK
X
Xcase $OP in
Xf|p)
X LOGFILE=$POSTLOGFILE
X ;;
Xr|m)
X LOGFILE=$MAILLOGFILE
Xesac
X
XMENU='Actions:
X
Xa - abort
Xe - edit
Xl - list
Xs - send
X
XSelect: '
XACTION=e
X
Xwhile :
Xdo
X case $ACTION in
X a)
X echo -n 'confirm abort: [ny] '
X read ans || ans=y
X [ x"$ans" = xy ] && {
X echo abort
X rm -f $WORK $TRACE
X exit 0
X }
X ;;
X e)
X ${EDITOR-${VISUAL-vi}} $WORK
X ;;
X l)
X ${PAGER-more} $WORK
X ;;
X s)
X echo -n 'confirm send: [ny] '
X read ans || ans=n
X [ x"$ans" = xy ] && {
X echo -n "Append a copy to $LOGFILE? [ny] "
X read ans
X [ x"$ans" = xy ] && (
X # use MMDF mailbox format
X sep=`echo AAAA | tr A \\\\1`
X echo "$sep"
X # incompatible `Date:' format :-(
X # `Tue Dec 19 23:43:09 MET 1989' becomes
X # `Tue, 19 Dec 89 23:43:09 MET 1989'
X # (indeed: year twice)
X set `date`
X shift 3
X echo "Date: `date '+%a, %d %h %y '` $*"
X cat $WORK
X echo "$sep"
X ) >> $LOGFILE
X
X case $OP in
X r|m)
X $SENDMAIL < $WORK > $TRACE 2>&1
X ;;
X f|p)
X $INEWS -h < $WORK > $TRACE 2>&1
X esac
X
X [ $? = 0 ] && break
X
X cat $TRACE
X }
X ;;
X *)
X echo "Unknown command \`$ACTION'"
X esac
X
X echo -n "$MENU"
X read ACTION || ACTION=a
Xdone
X
Xtrap '' 18 21 22 # ignore SIGTSTP, SIGTTIN and SIGTTOU in child :-(
X(
X # error messages to be ignored
X IGNORE="^inews: Cannot find my name '`hostname`' in"
X IGNORE="$IGNORE /usr/spool/news/lib/sys\$"
X
X sleep 30 # give inews a chance to finish processing :-(
X
X egrep -v -e "$IGNORE" $TRACE > /dev/null && {
X echo "To: $USER"
X echo "Subject: nn \`$OPERATION' failed"
X echo ''
X egrep -v -e "$IGNORE" $TRACE
X echo ''
X echo 'Your article/letter follows:'
X echo ''
X cat $WORK
X } | $SENDMAIL
X
X rm -f $WORK $TRACE
X) > /dev/null 2>&1 < /dev/null &
X
Xexit 0
+ END-OF-FILE nn-aux
chmod 'u=rwx,g=rx,o=rx' 'nn-aux'
set `wc -c 'nn-aux'`
count=$1
case $count in
6679) :;;
*) echo 'Bad character count in ''nn-aux' >&2
echo 'Count should be 6679' >&2
esac
exit 0
--
"COBOL is the revenge of some witch burned |Maarten Litmaath @ VU Amsterdam:
in Salem, [...]" (Bill Davidsen) |maart@cs.vu.nl, uunet!cs.vu.nl!maart
Re: alternative nn-aux script + macros, version 4.3 (nn6.4, nn6.3)
Author: Mike Weeks
Date: Mon, 04 Jun 1990 16:41
Date: Mon, 04 Jun 1990 16:41
10 lines
1198 bytes
1198 bytes
Perhaps I missed an article or two... Would the author of this alternative nn-aux script please post some documentation as to what this script does that the standard aux script does not do. I know, I could go through and read the shell scripts for aux and nn-aux and figure out what the differences are but I think it would be a lot simpler and less time consuming for the author to provide some documentation with his work. Perhaps I just missed the article which tells us why this nn-aux was posted. Mike Weeks Wicat Systems, Inc.
Re: alternative nn-aux script + macros, version 4.3 (nn6.4, nn6.3)
Author: Maarten Litmaath
Date: Tue, 05 Jun 1990 20:00
Date: Tue, 05 Jun 1990 20:00
19 lines
1775 bytes
1775 bytes
In article <461@wicat.UUCP>, michael@wicat.UUCP (Mike Weeks) writes: )Perhaps I missed an article or two... Would the author of this alternative )nn-aux script please post some documentation as to what this script does that )the standard aux script does not do. [...] Once upon a time I was using 2 newsreaders, namely `rn' and `nn'. (Nowadays there's only `nn', thank God (Kim!).) Well, I wanted the various followup/reply/... operations to be consistent, so I wrote an alternative script. Furthermore there were other, temporary, local problems with the `aux' script as well. In this newsgroup and in other groups I often read articles from people having problems with `Reply-To' lines etc.; whatever, with nn-aux they can configure things the way they *themselves* want them. I you're happy with the standard `aux' script, just dump `nn-aux' in the bitbucket and go your merry way. -- "COBOL is the revenge of some witch burned |Maarten Litmaath @ VU Amsterdam: in Salem, [...]" (Bill Davidsen) |maart@cs.vu.nl, uunet!cs.vu.nl!maart
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads