From caen!spool.mu.edu!howland.reston.ans.net!pipex!uunet!news2.uunet.ca!ionews.io.org!r-node.io.org!nobody Sun Oct 10 13:27:16 EDT 1993 Article: 5632 of comp.binaries.apple2 Path: caen!spool.mu.edu!howland.reston.ans.net!pipex!uunet!news2.uunet.ca!ionews.io.org!r-node.io.org!nobody From: taob@r-node.io.org (Brian Tao) Newsgroups: comp.binaries.apple2 Subject: binpost 1.1 (part 1/1) Date: 9 Oct 1993 03:56:40 -0400 Organization: Internex Online (io.org) Data: 416-363-3783 Voice: 416-363-8676 Lines: 156 Message-ID: <295qro$3ap@r-node.io.org> NNTP-Posting-Host: r-node.io.org Here is the shell script I wrote to help deliver multi-part Binscii files. In the olden days, you had to read in each segment into the newsreader editor and manually type in the newsgroup name and subject. Sometimes you lose track of which files have been posted, or you make silly typos in the subject line. Binpost avoids all that by automating the procedure as much as possible. The script is documented at the beginning and it is very easy to use. Just follow the prompts! Please send suggestions for features to taob@io.org. Thanks. --- BEGIN --- #!/bin/sh # BINPOST - Automated delivery of multi-part Binscii segments for UNIX # Written by Brian Tao, version date: 93/10/09 02:18 (1.1) # E-mail: or <90taobri@wave.scar.utoronto.ca> # ######################################################################## # # To use binpost, you must have execute privileges on your system's # `inews' news posting script. All servers using Bnews or Cnews # software to process Usenet news should have this file. It is # typically located in /usr/local/bin or /usr/lib/news. Ask you # system administrator if you can't locate the file. Set the INEWS # variable below to the correct pathname and append the "-h" switch. # This tells `inews' to take the headers from stdin rather than from # the command line. # # DEFGROUP defines the newsgroup to be posted to if none is specified. # Since binpost was written specifically with Binscii segments in mind, # there shouldn't be any need to change this. # # Supply the filenames on the command line (e.g., "binpost foobar.*") # and follow the prompts on the screen. Binpost will use your standard # editor (as defined by the EDITOR environment variable) for entering # the description of the uploaded file. Once all the relevant info has # been amassed, binpost will add headers to each segment and use INEWS # to send them on their way. Then you will have the option of deleting # the Binscii files. # ####################################################################### DEFGROUP="comp.binaries.apple2" INEWS="/usr/local/bin/inews -h" if [ $# -eq 0 ] ; then echo "$0: No files to post." exit 1 fi read -p "Enter newsgroup name [default is $DEFGROUP]: " NEWSGROUP if [ "x.$NEWSGROUP" = "x." ] ; then NEWSGROUP=$DEFGROUP fi read -p "Subject line: " SUBJECT if [ "x.$SUBJECT" = "x." ] ; then echo "" echo "No subject entered. Exeunt." exit fi read -p "Distribution [nothing for 'world']: " DISTR if [ "x.$DISTR" = "x." ] ; then DISTR="" fi TMPFILE=TmP.$$ BLURB=BlUrB.$$ if [ "x.$EDITOR" != "x." ] ; then echo "--------------------------------------------" >> $BLURB echo "Name: " >> $BLURB echo "Version: " >> $BLURB echo "Computer: " >> $BLURB echo "Requirements: " >> $BLURB echo "--------------------------------------------" >> $BLURB echo "" >> $BLURB echo "" echo "You will now be asked to provide some information on this file" read -p "and to enter a brief description. Press Return to continue..." YN $EDITOR $BLURB echo "" read -p "Post description to $NEWSGROUP (n = no)? " YN if [ "x.$YN" != "x.n" ] ; then echo "Newsgroups: $NEWSGROUP" > $TMPFILE echo "Subject: $SUBJECT description (part 0/$#)" >> $TMPFILE echo "Distribution: $DISTR" >> $TMPFILE echo "" >> $TMPFILE cat $BLURB >> $TMPFILE echo "Posting description..." $INEWS < $TMPFILE if [ $? -ne 0 ] ; then echo "*** Error posting description!" fi fi rm $BLURB fi COUNT=1 for SEG in $@ { REMAIN=`expr $# - $COUNT` echo "Newsgroups: $NEWSGROUP" > $TMPFILE echo "Subject: $SUBJECT (part $COUNT/$#)" >> $TMPFILE echo "Distribution: $DISTR" >> $TMPFILE echo "" >> $TMPFILE echo " --- Delivered by binpost 1.1, written by Brian Tao ---" >> $TMPFILE echo " --- For more information on binpost, e-mail taob@io.org ---" >> $TMPFILE echo "" >> $TMPFILE if [ $COUNT -eq 1 ] ; then echo "This is a Binscii file. You need a Binscii decoder to turn this" >> $TMPFILE echo "file back into its original form (usually a ShrinkIt file). The" >> $TMPFILE echo "following software is available:" >> $TMPFILE echo "" >> $TMPFILE echo "ProDOS 8 -> BINSCII" >> $TMPFILE echo "GS/OS -> GScii+ NDA (desktop), sscii (shell EXE)" >> $TMPFILE echo "UNIX -> sciibin, bsc" >> $TMPFILE echo "" >> $TMPFILE echo "Send suggestions for changes to this blurb to taob@io.org." >> $TMPFILE echo "" >> $TMPFILE else echo "Please see part 1 of this posting for decoding information." >> $TMPFILE echo "" >> $TMPFILE fi if [ $REMAIN -gt 1 ] ; then echo "This is part $COUNT of $#. There are $REMAIN more parts to follow." >> $TMPFILE elif [ $REMAIN -eq 1 ] ; then echo "This is part $COUNT of $#. There is one more part to follow." >> $TMPFILE else echo "This is part $COUNT of $#. All parts have been posted." >> $TMPFILE echo "Make sure you have all the parts before downloading!" >> $TMPFILE fi echo "-----------------------------------------------------------------" >> $TMPFILE cat $SEG >> $TMPFILE echo "Posting part $COUNT of $#..." $INEWS < $TMPFILE if [ $? -ne 0 ] ; then echo "*** Error posting segment $COUNT!" fi COUNT=`expr $COUNT + 1` } rm $TMPFILE read -p "Remove Binscii files (y = yes)? " YN if [ "x.$YN" = "x.y" ] ; then rm $@ fi -- Brian Tao:: taob@io.org (Internex Online, 416-363-3783, 17 lines, v.32bis) ::::::::::: 90taobri@wave.scar.utoronto.ca (University of Toronto, 9T4)