Path: news.uiowa.edu!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.2.1 (part 1/1) Date: 18 Oct 1993 14:11:53 -0400 Organization: Internex Online (io.org) Data: 416-363-3783 Voice: 416-363-8676 Lines: 207 Message-ID: <29um99$l6s@r-node.io.org> NNTP-Posting-Host: r-node.io.org Here is the UNIX shell script I have been using to post the MicroEMACS and Truetype samples archives for the past week. Save this message to a file and cut out everything above the "#!/bin/sh" line. To use this script, you need execute permission on the 'inews' software. If you can post news articles at your site, then you probably have access to 'inews'. Please read the comments embedded in the script carefully before using. I suggest making a couple of runs in "debug" mode first. If you don't understand how it works, please e-mail me at taob@io.org. ------------------------------------------------------------------------ #!/bin/sh # BINPOST - Automated delivery of multi-part Binscii segments for UNIX # Written by Brian Tao, version date: 93/10/11 13:28 (1.2.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 your # 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. # # 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. # # # # # # # # # # # # # # # # # # # # # # # # # # # 1.2 - Checksum line added just before start of Binscii segment. # - Replaced POSIX "read -p" with "echo -n/read" combination. # - Cleaned up long stretches of "echo >> $TMPFILE" statements. # # 1.2.1 - Changed 'echo -----' to echo '=====' (line 168) for better # compatibility. # - Added CKSUM variable. # - Added debugging hint and more comments. # - Correction: UNIX 'bsc' does *not* unbinscii! # ####################################################################### # DEFGROUP defines the newsgroup to be posted to if none is specified. # Since binpost was written specifically with Binscii segments in mind # (and thus posting to comp.binaries.apple2), there shouldn't be any # need to change this. DEFGROUP="comp.binaries.apple2" # On BSD systems, the CKSUM variable should be set to "sum". On SysV # systems, "sum -r" will produce compatible results. You should also # edit the blurb on line 170 to reflect the checksum used (especially # if you specified a less obvious one like "brik" or "cksum"). If # you do not want to generate checksums, set CKSUM to an empty string. CKSUM="sum" # For debugging purposes, define INEWS as a text pager (like "more" # or "less" or "page"). This will send the final formatted message # to the screen rather than posting it to the world. INEWS="/usr/local/bin/inews -h" if [ $# -eq 0 ] ; then echo "$0: No files to post." exit 1 fi echo -n "Enter newsgroup name [default is $DEFGROUP]: " read NEWSGROUP if [ "x.$NEWSGROUP" = "x." ] ; then NEWSGROUP=$DEFGROUP fi echo -n "Subject line: " read SUBJECT if [ "x.$SUBJECT" = "x." ] ; then echo "" echo "No subject entered. Exeunt." exit fi echo -n "Distribution [nothing for 'world']: " read DISTR if [ "x.$DISTR" = "x." ] ; then DISTR="" fi TMPFILE="binpost_$$" # You may specify a full pathname as well, BLURB="bp-blurb_$$" # like TMPFILE="/tmp/binpost_$$" if [ "x.$EDITOR" != "x." ] ; then cat << EOF > $BLURB -------------------------------------------- Name: Version: Author: Computer: Requires: -------------------------------------------- EOF echo "" echo "You will now be asked to provide some information on this file" echo -n "and to enter a brief description. Press Return to continue..." read YN $EDITOR $BLURB echo "" echo -n "Post description to $NEWSGROUP (n = no)? " read 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 cat << EOF >> $TMPFILE --- Delivered by binpost 1.2.1, written by Brian Tao --- --- For more information on binpost, e-mail taob@io.org --- EOF if [ $COUNT -eq 1 ] ; then cat << EOF >> $TMPFILE This is a Binscii file. You need a Binscii decoder to turn this file back into its original form (usually a ShrinkIt file). The following software is available: ProDOS 8 -> BINSCII GS/OS -> GScii+ (NDA), sscii/descii (shell EXE's) UNIX -> sciibin Send suggestions for changes to this blurb to taob@io.org. EOF 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 echo "=================================================================" >> $TMPFILE if [ "x.$CKSUM" != "x." ] ; then echo "BSD 'sum' and SysV 'sum -r' output: `$CKSUM $SEG`" >> $TMPFILE echo "=================================================================" >> $TMPFILE fi 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 echo -n "Remove Binscii files (y = yes)? " read 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)