README 644 2052 24 1226 5547240227 5014 This tar file contains the first public release of the Binpost 2.0 file posting script for UNIX. Please be sure to read through at least the CAVEATS and BUGS sections of the man pages if nothing else. There have been several changes since the last 2.0 beta, and dozens of new features since 1.4, the last public release. Everything is detailed in the man pages. I went to a lot of trouble writing them, so please read them! :) binpost - this is the shell script binpost.1 - nroff man page binpost.man - formatted man page (nroff -man binpost.1 > binpost.man) Comments, bugs, suggestions, etc. to taob@io.org. - Brian Tao March 25, 1994. binpost 755 2052 24 20546 5547232664 5574 #!/bin/sh # BINPOST - Automated delivery of multi-part Binscii segments for UNIX # Written by Brian Tao, version date: 94/03/25 14:37 (2.0) # E-mail: taob@io.org (Brian Tao) # ################## (This file formatted with tab width of 4) ################## DEF_GROUP="comp.binaries.apple2" # Default newsgroup DEF_REPLY="comp.sys.apple2" # Default followup CKSUM="sum" # Checksum utility POSTER="/usr/local/bin/inews" # Location of inews #################### DON'T TOUCH ANYTHING BELOW THIS LINE! #################### # If you need help, please send e-mail to Brian Tao at taob@io.org # ############################################################################### POSTER="$POSTER -h" VERSION="2.0" MSGID=$USER-`date +%y%m%d%H%M%S`@`hostname` CMD=`basename $0` SHKLIST="" VERBOSE="" DEBUG="" OPTIONS="" NEWSGROUP="" FOLLOWUP="" SUBJECT="" clean () { rm -rf $TMPFILE $BLURB 2> /dev/null exit } trap clean 0 1 2 3 4 5 6 7 8 9 10 12 15 # ## (Process command line arguments) ### while getopts cdls:vD:F:K:N:S:V OPTIONS do case $OPTIONS in c) cat << EOF ---------------------------------------- Name: Version: Author: Computer: Requires: ---------------------------------------- EOF exit ;; d) if [ ! "$DEBUG" ] ; then DEBUG="on" echo "$CMD: Level 1 debugging activated!" 1>&2 POSTER=${PAGER:-"more"} else echo "$CMD: Level 2 debugging activated!" 1>&2 set -x fi ;; l) SHKLIST="foo";; s) SHKFILE=$OPTARG if [ ! -s "$SHKFILE" ] ; then echo "$CMD: $SHKFILE doesn't exist!" 1>&2 exit 1 fi ;; v) VERBOSE="foo";; D) BLURB=$OPTARG if [ ! -s "$BLURB" ] ; then echo "$CMD: Description file $BLURB doesn't exist!" 1>&2 exit 1 fi ;; F) FOLLOWUP=$OPTARG;; K) KEYWORDS=$OPTARG;; N) NEWSGROUP=$OPTARG;; S) SUBJECT=$OPTARG;; V) echo "Binpost $VERSION (Mar 25 1994)" echo "Written by Brian Tao " exit;; *) echo "Usage: $CMD [-cdlVv] [-s sfile] [-D dfile] [-F followup] [-K keywords]" 1>&2 echo " [-N newsgroup] [-S subject] [segment1 segment2 ...]" 1>&2 exit 1;; esac done # ## ( Create/count Binscii segments) ### if [ "$SHKFILE" ] ; then bsc -t0xe0 -a0x8002 -s3 $SHKFILE if [ $? != 0 ] ; then echo "$CMD: Error using bsc!" 1>&2 exit 1 else ARGV=`echo $SHKFILE.[0-9]*` fi else shift `expr $OPTIND - 1` if [ $# -ne 0 ] ; then for SEG in $@ { if [ ! -s "$SEG" ] ; then echo "$CMD: Segment $SEG does not exist!" 1>&2 exit 1 fi } ARGV=$@ else echo "$CMD: Nothing to post." 1>&2 exit 1 fi fi set $ARGV TOTAL=$# if [ "$VERBOSE" ] ; then echo "Binpost $VERSION found $TOTAL segment(s) to post." fi if [ "$DEBUG" ] ; then echo "Segment names: $ARGV" fi # ## (Define print function) ### ECHO=`echo -n Hello` if [ "$ECHO" = "-n Hello" ] ; then print () { echo "$@\c" } else print () { echo -n "$@" } fi # ## (Prompt for header information) ### if [ "$NEWSGROUP" ] ; then if [ "$VERBOSE" ] ; then echo "Posting to newsgroup $NEWSGROUP." fi else print "Post to newsgroup [$DEF_GROUP]: " read NEWSGROUP NEWSGROUP=${NEWSGROUP:-$DEF_GROUP} fi if [ "$FOLLOWUP" ] ; then if [ "$VERBOSE" ] ; then echo "Setting followup to $FOLLOWUP." fi else print "Followup to [$DEF_REPLY]: " read FOLLOWUP FOLLOWUP=${FOLLOWUP:-$DEF_REPLY} fi if [ "$SUBJECT" ] ; then if [ "$VERBOSE" ] ; then echo "Subject will be \"$SUBJECT\"." fi else print "Subject line: " read SUBJECT if [ ! "$SUBJECT" ] ; then echo "" echo "$CMD: No subject entered." 1>&2 exit 1 fi fi # ## (Get description) ### if [ "$BLURB" ] ; then if [ "$VERBOSE" ] ; then echo "The description file \"$BLURB\" will be used." fi cp $BLURB $HOME/bp-blurb_$$ BLURB="$HOME/bp-blurb_$$" else echo "" echo "You will now be asked to provide some information on this file" print "and to enter a brief description." if [ ! "$EDITOR" ] ; then echo "" echo "" print "Editor to use [/usr/bin/vi]: " read EDITOR EDITOR=${EDITOR:-"/usr/bin/vi"} else print " Press Return to continue..." read YN fi BLURB="$HOME/bp-blurb_$$" cat << EOF > $BLURB ---------------------------------------- Name: Version: Author: Computer: Requires: ---------------------------------------- EOF $EDITOR $BLURB if [ $? -ne 0 ] ; then echo "" echo "$CMD: Error invoking editor!" 1>&2 exit 1 fi fi if [ "$KEYWORDS" ] ; then if [ "$VERBOSE" ] ; then echo "Keyword list: $KEYWORDS" fi else echo "" echo "You may now enter an optional list of keywords to be included" echo "with each segment. Just press Return if you don't want one." print ":" read KEYWORDS fi TMPFILE="$HOME/binpost_$$" echo "Newsgroups: $NEWSGROUP" > $TMPFILE echo "Followup-To: $FOLLOWUP" >> $TMPFILE echo "Subject: $SUBJECT (description)" >> $TMPFILE echo "Message-ID: <$MSGID>" >> $TMPFILE echo "Keywords: $KEYWORDS" >> $TMPFILE echo "Distribution: " >> $TMPFILE echo "" >> $TMPFILE cat $BLURB >> $TMPFILE cat << EOF >> $TMPFILE : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : EOF if [ "$VERBOSE" ] ; then echo "" print "Calculating checksums... " fi echo "'$CKSUM' results for each segment:" >> $TMPFILE COUNT=1 for SEG in $ARGV { echo " Part $COUNT of $TOTAL = `$CKSUM $SEG`" >> $TMPFILE COUNT=`expr $COUNT + 1` } if [ "$SHKFILE" ] ; then echo ">>> Archive checksum = `$CKSUM $SHKFILE`" >> $TMPFILE if [ "$SHKLIST" ] ; then cat << EOF >> $TMPFILE : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : EOF nulib tv $SHKFILE >> $TMPFILE if [ $? != 0 ] ; then echo "" echo "$CMD: Error using nulib!" 1>&2 exit 1 fi fi fi if [ "$VERBOSE" ] ; then echo "done!" print "Posting description... " fi $POSTER < $TMPFILE if [ $? -ne 0 ] ; then echo "" echo "$CMD: Error posting description!" exit 1 else if [ "$VERBOSE" ] ; then echo "done!" fi fi # ## (Post Binscii segments) ### COUNT=1 for SEG in $ARGV { REMAIN=`expr $TOTAL - $COUNT` echo "Newsgroups: $NEWSGROUP" > $TMPFILE echo "Followup-To: $FOLLOWUP" >> $TMPFILE echo "Subject: $SUBJECT (part $COUNT/$TOTAL)" >> $TMPFILE echo "References: <$MSGID>" >> $TMPFILE echo "Keywords: $KEYWORDS" >> $TMPFILE echo "Distribution: " >> $TMPFILE echo "" >> $TMPFILE if [ $COUNT -eq 1 ] ; then cat << EOF >> $TMPFILE --- Delivered by Binpost $VERSION, written by Brian Tao --- --- For more information on Binpost, e-mail taob@io.org --- 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: BINSCII (P8), GScii+ (NDA), sscii (shell EXE), descii (shell EXE) and sciibin (UNIX). If you have any questions about this file format or you need help decoding it, please post to the appropriate newsgroup, not comp.binaries.apple2! Keep in mind that the file segments may not show up in the right order, so double-check the file before downloading it (see the description post for checksums). 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 $TOTAL. There are $REMAIN more parts to follow." >> $TMPFILE echo "Be patient! They may not show up all at once!" >> $TMPFILE elif [ $REMAIN -eq 1 ] ; then echo "This is part $COUNT of $TOTAL. There is one more part to follow." >> $TMPFILE echo "Be patient! They may not show up all at once!" >> $TMPFILE else if [ $TOTAL -eq 1 ] ; then echo "This is the only Binscii segment in this file." >> $TMPFILE else echo "This is part $COUNT of $TOTAL. All parts have been posted." >> $TMPFILE echo "Make sure you have all the parts before downloading!" >> $TMPFILE fi fi echo "" >> $TMPFILE echo "================================================================" >> $TMPFILE cat $SEG >> $TMPFILE if [ "$VERBOSE" ] ; then print "Posting part $COUNT of $TOTAL (file is $SEG)... " fi $POSTER < $TMPFILE if [ $? -ne 0 ] ; then echo "$CMD: Error posting segment $COUNT!" else if [ "$VERBOSE" ] ; then echo "done!" fi fi COUNT=`expr $COUNT + 1` } # ## (Clean up) ### if [ "$VERBOSE" ] ; then print "Remove Binscii files (y/n)? [n] " read YN if [ "$YN" = "y" ] ; then rm -rf $ARGV 2> /dev/null print "Binscii files removed. " else print "Binscii files not removed. " fi echo "Thank you for using Binpost 2.0!" fi e shift `expr $OPTIND - 1` if [ $# -ne 0 ] ; then for SEG in $@ { if [ ! -s "$SEG" ] ; then echo "$CMD: Segment $SEG does not exist!" 1>&2 binpost.1 644 2052 24 34075 5547240502 5720 .TH BINPOST 1 "25 March 1994" .SH NAME binpost \- post multiple Binscii segments to netnews .SH SYNOPSIS .HP 8 .B binpost [-cdlVv] [-s .I file ] [-D .I file ] [-F .I followup ] [-K .I keywords ] [-N .I newsgroup ] [-S .I subject ] .I segments .SH DESCRIPTION .LP .B Binpost provides a convenient way to post binary files to Usenet newsgroups with a minimum of hassle, while maintaining a consistent format. It automates many of the functions normally associated with posting a file to netnews, including: converting the binary file to a multi-part Binscii archive, creating consistent news article headers, serializing the Subject line, calculating checksums, and threading related Binscii segments. .B Binpost interacts directly with the news transport agent for maximum control over the format and content of posted files. Once the required information is supplied by the user, .B binpost will generate the appropriate article headers, append optional information (checksums, archive listings, decoding information, etc.), and submit each segment to the news system for delivery. Errors due to user carelessness are virtually eliminated, and even very large files with dozens of segments can be quickly posted in minutes with minimum user intervention. .SH OPTIONS A large assortment of options are available from the command line, allowing completely automated batch processing of file posting from a shell script. .HP 4 -c Echo a standard file description template to stdout. The output from -c is meant to be redirected into a file and the completed description used with the -D option. .HP 4 -d Turns on two levels of debugging output. Level 1 debugging prints additional status messages to stdout and pipes the resulting news articles to PAGER (or 'more' if PAGER is not set) rather than submitting them to inews. If a second '-d' is specified, Level 2 debugging is activated. In addition to Level 1, all script statements are echoed to stdout as they are executed. It is recommended that Level 2 debugging output be included in bug reports. .HP 4 -l Append a ShrinkIt archive listing after the file's description. This switch is only valid in combination with -s. An error message will be printed if Andy McFadden's .B nulib utility cannot be found. .HP 4 -v Turns on verbose output. Certain user options will be echoed back to stdout for confirmation and the number of Binscii segments to be posted will be displayed at the start. Progress reports are printed during the actual submission of news articles. When the complete file has been posted, .B binpost will confirm the deletion of the Binscii segments. .HP 4 -V Prints the version number and revision date. .HP 4 -D .I dfile .RS 4 Use .I dfile as the description message. If this isn't specified, .B binpost will prompt you to supply a description. Use the -c option to create a standard description template. .RE -F .I newsgroup .RS 4 Redirect followups to .I newsgroup. If this isn't specified, you will be prompted to enter one. This switch is provided to satisfy the majority of people who are irritated by non-binary posts in binaries newsgroups. Set the followup to "poster" if you want replies directed to you in e-mail. .RE -K .I keywords .RS 4 Supply .I keywords to be included in the news article header. If this isn't specified, you will be prompted to enter some. Since this is an optional header, use -K "" on the command line to prevent .B binpost from prompting for keywords. .RE -N .I newsgroup .RS 4 Post the file to .I newsgroup. If this isn't specified, you will be prompted to enter one. This one is obvious: Binscii segments will end up in this newsgroup. .RE -S .I subject .RS 4 Set the subject line to .I subject. If this isn't specified, you will be prompted to enter one. .B Binpost will automatically append the "(part xx/yy)" serial number to the end of the subject. .RE -s .I sfile .RS 4 Convert ShrinkIt file .I sfile to Binscii before posting. By default, .B binpost expects the names of Binscii segments on the command line. However, it is more expedient in most cases to upload a smaller ShrinkIt archive and have .B binpost convert it to Binscii. This is the only way to automatically include an archive listing (-l option) in the file's description. An error message will be printed if Neil Parker's .B bsc utility cannot be found. If the -s option is specified, Binscii segments names should not be specified. .SH USAGE .LP .B Binpost takes Binscii segments (either provided by the user, or generated from a ShrinkIt file) and posts them to netnews in a consistently formatted manner. Before the advent of .B binpost (and other such automated posters), the tedium of submitting each segment by hand was nearly unbearable. Much of the highly repetitive work is well-suited for a shell script, and .B binpost does this very nicely. Vital information about the file is requested from the user, then each Binscii segment is embellished with the proper news headers, informative blurbs, and submitted to the newsgroup. Any system that uses the B or C News software package to manage its local Usenet activity will be able to take advantage of .B binpost. Before running the script, check that the variables used by .B binpost are set to your liking. DEF_GROUP defines the default newsgroup to which the Binscii segments will be posted. DEF_REPLY is the default newsgroup to which replies will be directed. As distributed, these variables are set to comp.binaries.apple2 and comp.sys.apple2, respectively. These can be overriden by command line options or through the user prompts. CKSUM specifies the command line used to generate segment and archive checksums. Normally, the .B sum command will be sufficient. However, you may elect to use an alternative method such as .B brik. SysV users should consider using 'sum -r' to produce output compatible with BSD .B sum. POSTER specifies the absolute pathname to the news transport agent. It may vary from system to system, but try looking in /usr/local/news/inews, /usr/local/bin/inews or /usr/news/bin/inews. The 'whereis' command might help in locating .B inews, or contact your local system administrator. Note that .B binpost automatically appends the -h switch which tells .B inews to take its news headers from stdin rather than from the command line. Do not supply any switches in POSTER, or the results will be unpredictable (and unsupported by the author). Turning on debugging output sets POSTER to your PAGER environment variable (or 'more', if PAGER is not set). This allows you to preview outgoing articles without wasting bandwidth. In an interactive session, .B binpost displays several prompts on the screen when it needs information from the user. Values contained in [square brackets] following the prompt are the defaults. Pressing Return will accept those values. Some prompts (e.g., for the Subject and Keywords headers) do not have default values. Hitting Return in those cases will signify a blank line. .B Binpost will use .B nulib (to produce archive listings) and .B bsc (to convert a file into Binscii format) if instructed to do so with command line switches. Please ensure that those utilities are located in your PATH. .B Binpost may not be able to find them otherwise. If an archive listing is specified, .B binpost will place it in the file description message. This message should contain a brief description of the file and may also list the checksums of the Binscii segments to follow, the checksum of the original file, and the optional archive listing. By convention, files are uploaded with three Binscii segments per post. This number was chosen because the resulting message size falls within the 64K limit some older news and mail systems continue to enforce. Each Binscii message is sequentially numbered, with Part 1 being the first that contains actual Binscii data. That message will also have a brief message containing information on decoding the Binscii archive. Subsequent messages simply contain a sentence or two with the number of messages remaining, and a reminder to check the completeness of the archive before downloading. For multi-part postings, .B binpost threads all the segments together. This is for the benefit of threaded newsreaders such as .B nn or .B trn. This feature allows you to select an entire series of messages for saving or decoding with a single keypress. The Binscii segments are "anchored" to the description message so it is the first article displayed with a threaded newsreader. Those still using .B rn should consider leaving the Stone Age behind and installing a threaded newsreader on their system. Uploaded files may be decoded on-the-fly if the .B sciibin utility is available on your system. Assuming it is located in your PATH, use your newsreader's "pipe" command to send the selected articles through .B sciibin. For example, after choosing the desired files from the article or thread selection menu in .B trn, use the ":|sciibin" (no quotes) to decode the files. A list of article numbers will be printed on the screen while the decoding takes place. You may see the occasional "sciibin: not a binscii file" error. This is usually caused by .B sciibin attempting to decode a description message. Other errors may indicate a corrupt file. Check those carefully. .SH EXAMPLES .LP The simplest form of the command simply lists the filenames of the Binscii segments: example% binpost segments.bsq.* A more common usage (assuming you have both nulib and bsc compiled on your system) takes the name of a ShrinkIt archive and requests that an archive listing be appended to the end of the description. Status messages and progress reports will also be printed: example% binpost -vls newgame.shk For unattended, non-interactive posting, all parameters must be specified on the command line. This example will post a file in the background with no status messages: example% binpost -ls newgame.shk -N comp.binaries.apple2 -F comp.sys.apple2 -S "Cool new game" -K "game,fun,gs" -D game.desc & .SH CAVEATS .LP Bourne shells on some systems (notably, AIX and HP-UX) may not have the 'getopts' command. In those instances, try substituting "#!/bin/ksh" (the Korn shell) for "#!/bin/sh" in the first line of the script. In fact, you may want to try this if you notice any strange behaviour at all (like unexpected "sigproc" or "trap" errors or other warnings). NeXTStep's 'date' command apparently does not take format specifiers.\ .B Binpost needs this feature to construct a unique Message-ID header for the description post. If you absolutely must use .B binpost on a NeXTStep machine, contact the author for a solution. Some implementations of the Bourne shell built-in 'test' command do not correctly handle null string arguments.\ .B Binpost needs one that works properly. To test this on your system, issue a "binpost -d" (no other arguments). It should respond: binpost: Level 1 debugging activated! binpost: Nothing to post. If instead it says "Level 2 debugging activated!" and proceeds to print several lines of script, you have a buggy implementation. For reasons that I have yet to determine, the 'trap' built-in command messes up the whole script on the local BSDI 1.1 system. Commenting out that line seems to fix things (line 36). You may want to try this fix if the above test for 'test' fails. Keep in mind that .B nulib does not handle ShrinkIt files with Binary II wrappers (commonly denoted with a .BXY extension). If you attempt to include a file listing (the -l switch) of a BXY file, .B binpost will complain of an error while using .B nulib. Future versions may handle this in a more intelligent manner (i.e., by giving .B nulib the 'b' parameter to list BXY files). .SH BUGS .LP A file with more than nine segments will not be posted in strict archive order because the Binscii filenames are sorted lexically (i.e., foo.1 foo.10 foo.11 foo.12 foo.2 foo.3 ...) and not numerically. This isn't really a problem since a Binscii decoder should not care about the order of the segments. See also the .B CAVEATS section. .SH REVISION HISTORY .PD 0 1.0/1.1 - First public release. 1.2 - Checksum line added before start of Binscii segment. - Replaced POSIX "read -p" with "echo -n/read" - Cleaned up "echo >> $TMPFILE" statements. 1.2.1 - Added CKSUM variable. - Added debugging hint and more comments. - Correction: UNIX 'bsc' does *not* unbinscii! .HP 6 1.3 - Wrote print() function to use proper 'echo' syntax. Should work identically on both SysV and BSD systems now. .RE - Removed option to post detailed description. .HP 6 - Asks for optional one-line summary to be placed in header. .RE - Prompts for editor if one not defined in $EDITOR. - Changed "parts left" message if only one segment. - Copies $@ to $ARGV for safekeeping. .HP 6 1.4 - Begins by printing version and number of segments found. .RE .HP 6 - The print() function will now echo all of its arguments instead of just the first one. .RE - Added "Followup-To:" header to all segments. .HP 6 - Moved all checksum information into the file description. .RE - Copies $# to $TOTAL for safekeeping. - Temporary files now created in home directory. .HP 6 2.0 - Added "-c" command line switch to Create description header. .RE - Added "-d" switch (Debugging output). - Added "-l" switch (include archive Listing). - Added "-s" switch (use Shrinkit archive). - Added "-v" switch (Verbose mode). - Added "-D" switch (use Description file). - Added "-F" switch (Followup line). - Added "-K" switch (Keywords line). - Added "-N" switch (Newsgroups line). - Added "-S" switch (Subject line). - Added "-V" switch (Version info). - /bin/sh builtin "getopts" required for operation. .HP 6 - Related segments now referenced to description for faster selection in threaded newsreaders like trn or nn. .RE - Calculates checksum of ShrinkIt archive. - Home directory now specified as $HOME rather than ~. - Summary header changed to Keywords header. .HP 6 - More minor aesthetic changes (wording of prompts, etc.) .RE - Changed INEWS variable to POSTER - Honours PAGER variable with -d switch .SH AUTHOR Brian Tao ator. Note that .B binpost automatically appends the -h switch which tells .B inews to take its news headers from stdin rather than from the command line. Do not supply any switches in POSTER, or the results will be unpredictable (and unsupported by the author). Turning on debugging output sets POSTER to your PAGER environment variable (or 'more', if PAGER is not set). This allows you to preview outgoing articles without wasting bandwidth. Inbinpost.man 644 2052 24 44420 5547241335 6333 BINPOST(1) BINPOST(1) NNAAMMEE binpost - post multiple Binscii segments to netnews SSYYNNOOPPSSIISS bbiinnppoosstt [-cdlVv] [-s _f_i_l_e ] [-D _f_i_l_e ] [-F _f_o_l_l_o_w_u_p ] [-K _k_e_y_w_o_r_d_s ] [-N _n_e_w_s_g_r_o_u_p ] [-S _s_u_b_j_e_c_t ] _s_e_g_m_e_n_t_s DDEESSCCRRIIPPTTIIOONN BBiinnppoosstt provides a convenient way to post binary files to Usenet newsgroups with a minimum of hassle, while main- taining a consistent format. It automates many of the functions normally associated with posting a file to net- news, including: converting the binary file to a multi- part Binscii archive, creating consistent news article headers, serializing the Subject line, calculating check- sums, and threading related Binscii segments. BBiinnppoosstt interacts directly with the news transport agent for maximum control over the format and content of posted files. Once the required information is supplied by the user, bbiinnppoosstt will generate the appropriate article head- ers, append optional information (checksums, archive list- ings, decoding information, etc.), and submit each segment to the news system for delivery. Errors due to user care- lessness are virtually eliminated, and even very large files with dozens of segments can be quickly posted in minutes with minimum user intervention. OOPPTTIIOONNSS A large assortment of options are available from the com- mand line, allowing completely automated batch processing of file posting from a shell script. -c Echo a standard file description template to stdout. The output from -c is meant to be redirected into a file and the completed description used with the -D option. -d Turns on two levels of debugging output. Level 1 debugging prints additional status messages to stdout and pipes the resulting news articles to PAGER (or 'more' if PAGER is not set) rather than submitting them to inews. If a second '-d' is specified, Level 2 debugging is activated. In addition to Level 1, all script statements are echoed to stdout as they are executed. It is recommended that Level 2 debugging output be included in bug reports. -l Append a ShrinkIt archive listing after the file's description. This switch is only valid in combination with -s. An error message will be printed if Andy McFadden's nnuulliibb utility cannot be found. 25 March 1994 1 BINPOST(1) BINPOST(1) -v Turns on verbose output. Certain user options will be echoed back to stdout for confirmation and the number of Binscii segments to be posted will be displayed at the start. Progress reports are printed during the actual submission of news articles. When the complete file has been posted, bbiinnppoosstt will confirm the dele- tion of the Binscii segments. -V Prints the version number and revision date. -D _d_f_i_l_e Use _d_f_i_l_e as the description message. If this isn't specified, bbiinnppoosstt will prompt you to supply a description. Use the -c option to create a standard description template. -F _n_e_w_s_g_r_o_u_p Redirect followups to _n_e_w_s_g_r_o_u_p_. If this isn't speci- fied, you will be prompted to enter one. This switch is provided to satisfy the majority of people who are irritated by non-binary posts in binaries newsgroups. Set the followup to "poster" if you want replies directed to you in e-mail. -K _k_e_y_w_o_r_d_s Supply _k_e_y_w_o_r_d_s to be included in the news article header. If this isn't specified, you will be prompted to enter some. Since this is an optional header, use -K "" on the command line to prevent bbiinnppoosstt from prompting for keywords. -N _n_e_w_s_g_r_o_u_p Post the file to _n_e_w_s_g_r_o_u_p_. If this isn't specified, you will be prompted to enter one. This one is obvi- ous: Binscii segments will end up in this newsgroup. -S _s_u_b_j_e_c_t Set the subject line to _s_u_b_j_e_c_t_. If this isn't speci- fied, you will be prompted to enter one. BBiinnppoosstt will automatically append the "(part xx/yy)" serial number to the end of the subject. -s _s_f_i_l_e Convert ShrinkIt file _s_f_i_l_e to Binscii before posting. By default, bbiinnppoosstt expects the names of Binscii seg- ments on the command line. However, it is more expe- dient in most cases to upload a smaller ShrinkIt archive and have bbiinnppoosstt convert it to Binscii. This is the only way to automatically include an archive listing (-l option) in the file's description. An error message will be printed if Neil Parker's bbsscc utility cannot be found. If the -s option is speci- fied, Binscii segments names should not be specified. 25 March 1994 2 BINPOST(1) BINPOST(1) UUSSAAGGEE BBiinnppoosstt takes Binscii segments (either provided by the user, or generated from a ShrinkIt file) and posts them to netnews in a consistently formatted manner. Before the advent of bbiinnppoosstt (and other such automated posters), the tedium of submitting each segment by hand was nearly unbearable. Much of the highly repetitive work is well- suited for a shell script, and bbiinnppoosstt does this very nicely. Vital information about the file is requested from the user, then each Binscii segment is embellished with the proper news headers, informative blurbs, and sub- mitted to the newsgroup. Any system that uses the B or C News software package to manage its local Usenet activity will be able to take advantage of bbiinnppoosstt.. Before running the script, check that the variables used by bbiinnppoosstt are set to your liking. DEF_GROUP defines the default newsgroup to which the Bin- scii segments will be posted. DEF_REPLY is the default newsgroup to which replies will be directed. As dis- tributed, these variables are set to comp.binaries.apple2 and comp.sys.apple2, respectively. These can be overriden by command line options or through the user prompts. CKSUM specifies the command line used to generate segment and archive checksums. Normally, the ssuumm command will be sufficient. However, you may elect to use an alternative method such as bbrriikk.. SysV users should consider using 'sum -r' to produce output compatible with BSD ssuumm.. POSTER specifies the absolute pathname to the news trans- port agent. It may vary from system to system, but try looking in /usr/local/news/inews, /usr/local/bin/inews or /usr/news/bin/inews. The 'whereis' command might help in locating iinneewwss,, or contact your local system administra- tor. Note that bbiinnppoosstt automatically appends the -h switch which tells iinneewwss to take its news headers from stdin rather than from the command line. Do not supply any switches in POSTER, or the results will be unpre- dictable (and unsupported by the author). Turning on debugging output sets POSTER to your PAGER environment variable (or 'more', if PAGER is not set). This allows you to preview outgoing articles without wasting band- width. In an interactive session, bbiinnppoosstt displays several prompts on the screen when it needs information from the user. Values contained in [square brackets] following the prompt are the defaults. Pressing Return will accept those values. Some prompts (e.g., for the Subject and Keywords headers) do not have default values. Hitting Return in those cases will signify a blank line. 25 March 1994 3 BINPOST(1) BINPOST(1) BBiinnppoosstt will use nnuulliibb (to produce archive listings) and bbsscc (to convert a file into Binscii format) if instructed to do so with command line switches. Please ensure that those utilities are located in your PATH. BBiinnppoosstt may not be able to find them otherwise. If an archive listing is specified, bbiinnppoosstt will place it in the file description message. This message should contain a brief description of the file and may also list the checksums of the Binscii segments to follow, the checksum of the original file, and the optional archive listing. By convention, files are uploaded with three Binscii seg- ments per post. This number was chosen because the resulting message size falls within the 64K limit some older news and mail systems continue to enforce. Each Binscii message is sequentially numbered, with Part 1 being the first that contains actual Binscii data. That message will also have a brief message containing informa- tion on decoding the Binscii archive. Subsequent messages simply contain a sentence or two with the number of mes- sages remaining, and a reminder to check the completeness of the archive before downloading. For multi-part postings, bbiinnppoosstt threads all the segments together. This is for the benefit of threaded newsreaders such as nnnn or ttrrnn.. This feature allows you to select an entire series of messages for saving or decoding with a single keypress. The Binscii segments are "anchored" to the description message so it is the first article dis- played with a threaded newsreader. Those still using rrnn should consider leaving the Stone Age behind and installing a threaded newsreader on their system. Uploaded files may be decoded on-the-fly if the sscciiiibbiinn utility is available on your system. Assuming it is located in your PATH, use your newsreader's "pipe" command to send the selected articles through sscciiiibbiinn.. For exam- ple, after choosing the desired files from the article or thread selection menu in ttrrnn,, use the ":|sciibin" (no quotes) to decode the files. A list of article numbers will be printed on the screen while the decoding takes place. You may see the occasional "sciibin: not a binscii file" error. This is usually caused by sscciiiibbiinn attempting to decode a description message. Other errors may indi- cate a corrupt file. Check those carefully. EEXXAAMMPPLLEESS The simplest form of the command simply lists the file- names of the Binscii segments: example% binpost segments.bsq.* 25 March 1994 4 BINPOST(1) BINPOST(1) A more common usage (assuming you have both nulib and bsc compiled on your system) takes the name of a ShrinkIt archive and requests that an archive listing be appended to the end of the description. Status messages and progress reports will also be printed: example% binpost -vls newgame.shk For unattended, non-interactive posting, all parameters must be specified on the command line. This example will post a file in the background with no status messages: example% binpost -ls newgame.shk -N comp.binaries.apple2 -F comp.sys.apple2 -S "Cool new game" -K "game,fun,gs" -D game.desc & CCAAVVEEAATTSS Bourne shells on some systems (notably, AIX and HP-UX) may not have the 'getopts' command. In those instances, try substituting "#!/bin/ksh" (the Korn shell) for "#!/bin/sh" in the first line of the script. In fact, you may want to try this if you notice any strange behaviour at all (like unexpected "sigproc" or "trap" errors or other warnings). NeXTStep's 'date' command apparently does not take format specifiers. BBiinnppoosstt needs this feature to construct a unique Message-ID header for the description post. If you absolutely must use bbiinnppoosstt on a NeXTStep machine, contact the author for a solution. Some implementations of the Bourne shell built-in 'test' command do not correctly handle null string arguments. BBiinnppoosstt needs one that works properly. To test this on your system, issue a "binpost -d" (no other arguments). It should respond: binpost: Level 1 debugging activated! binpost: Nothing to post. If instead it says "Level 2 debugging activated!" and pro- ceeds to print several lines of script, you have a buggy implementation. For reasons that I have yet to determine, the 'trap' built-in command messes up the whole script on the local BSDI 1.1 system. Commenting out that line seems to fix things (line 36). You may want to try this fix if the above test for 'test' fails. Keep in mind that nnuulliibb does not handle ShrinkIt files with Binary II wrappers (commonly denoted with a .BXY extension). If you attempt to include a file listing (the -l switch) of a BXY file, bbiinnppoosstt will complain of an 25 March 1994 5 BINPOST(1) BINPOST(1) error while using nnuulliibb.. Future versions may handle this in a more intelligent manner (i.e., by giving nnuulliibb the 'b' parameter to list BXY files). BBUUGGSS A file with more than nine segments will not be posted in strict archive order because the Binscii filenames are sorted lexically (i.e., foo.1 foo.10 foo.11 foo.12 foo.2 foo.3 ...) and not numerically. This isn't really a prob- lem since a Binscii decoder should not care about the order of the segments. See also the CCAAVVEEAATTSS section. RREEVVIISSIIOONN HHIISSTTOORRYY 1.0/1.1 - First public release. 1.2 - Checksum line added before start of Binscii segment. - Replaced POSIX "read -p" with "echo -n/read" - Cleaned up "echo >> $TMPFILE" statements. 1.2.1 - Added CKSUM variable. - Added debugging hint and more comments. - Correction: UNIX 'bsc' does *not* unbinscii! 1.3 - Wrote print() function to use proper 'echo' syntax. Should work identically on both SysV and BSD systems now. - Removed option to post detailed description. - Asks for optional one-line summary to be placed in header. - Prompts for editor if one not defined in $EDITOR. - Changed "parts left" message if only one segment. - Copies $@ to $ARGV for safekeeping. 1.4 - Begins by printing version and number of segments found. - The print() function will now echo all of its argu- ments instead of just the first one. - Added "Followup-To:" header to all segments. - Moved all checksum information into the file description. - Copies $# to $TOTAL for safekeeping. - Temporary files now created in home directory. 2.0 - Added "-c" command line switch to Create description header. - Added "-d" switch (Debugging output). - Added "-l" switch (include archive Listing). - Added "-s" switch (use Shrinkit archive). - Added "-v" switch (Verbose mode). - Added "-D" switch (use Description file). 25 March 1994 6 BINPOST(1) BINPOST(1) - Added "-F" switch (Followup line). - Added "-K" switch (Keywords line). - Added "-N" switch (Newsgroups line). - Added "-S" switch (Subject line). - Added "-V" switch (Version info). - /bin/sh builtin "getopts" required for operation. - Related segments now referenced to description for faster selection in threaded newsreaders like trn or nn. - Calculates checksum of ShrinkIt archive. - Home directory now specified as $HOME rather than ~. - Summary header changed to Keywords header. - More minor aesthetic changes (wording of prompts, etc.) - Changed INEWS variable to POSTER - Honours PAGER variable with -d switch AAUUTTHHOORR Brian Tao 25 March 1994 7 tion on decoding the Binscii archive. Subsequent messages simply contain a sentence or two with the number of mes- sages remaining, and a reminder to check the completeness of the archive before downloading. Use _d_f_i_l_e as the description message. If this isn't specified, bbiinnppoosstt will prompt you to supply a description. Use the -c option to create a standard description template. -F _n_e_w_s_g_r_o_u_p Redirect followups to _n_e_w_s_g_r_o_u_p_. If this isn't speci- fied, you will be prompted to enter one. This switch is provided to satisfy the majority of people who are irritated by non-binary posts in binaries newsgroups. Set the followup to "poster" if you want replies directed to you in e-mail. -K _k_e_y_w_o_r_d_s Supply _k_e_y_w_o_r_d_s to be included in the news article header. If this isn't specified, you will be prompted to enter some. Since this is an optional header, use -K "" on the command line to prevent bbiinnppoosstt from prompting for keywords. -N _n_e_w_s_g_r_o_u_p Post the file to _n_e_w_s_g_r_o_u_p_. If this isn't specified, you will be prompted to enter one. This one is obvi- ous: Binscii segments will end up in this newsgroup. -S _s_u_b_j_e_c_t Set the subject line to _s_u_b_j_e_c_t_. If this isn't speci- fied, you will be prompted to enter one. BBiinnppoosstt will automatically append the "(part xx/yy)" serial number to the end of the subject. -s _s_f_i_l_e Convert ShrinkIt file _s_f_i_l_e to Binscii before posting. By default, bbiinnppoosstt expects the names of Binscii seg- ments on the command line. However, it is more expe- dient in most cases to upload a smaller ShrinkIt archive and have bbiinnppoosstt convert it to Binscii. This is the only way to automatically include an archive listing (-l option) in the file's description. An error message will be printed if Neil Parker's bbsscc utility cannot be found. If the -s option is speci- fied, Binscii segments names should not be specified. 25 March 1994 2 BINPOST(1) BINPOST(1) UUSSAAGGEE BBiinnppoosstt takes Binscii segments (either provided by