: '@(#)postnews.v7 2.6 3/3/83' if test $# -gt 1 ; then echo "$0: Too many args" exit 1 fi if test $# -eq 1 -a ! -r "$1" ; then echo "$0: Can't read $1" exit 1 fi echo -n "Subject: " read title echo -n "Newsgroups (general): " read ng if test x$ng = x ; then ng=general fi case $# in 0) t=/tmp/pn$$ trap "sleep 1; cp $t $HOME/dead.article ; echo saved in $HOME/dead.article ; rm -f $t; exit" 1 2 echo "Subject: $title" > $t echo "Newsgroups: $ng" >> $t echo "" >> $t ${EDITOR-vi} $t if inews -h <$t then : else if cat $t >>$HOME/dead.article then echo Article saved in $HOME/dead.article fi fi ;; 1) inews -t "$title" -n $ng < $1 ;; esac sleep 1 rm -f $t