[comp.sys.apple] Usenet header remover ...

nakada@husc7.HARVARD.EDU (Paul Nakada) (04/16/88)

well I've finally kludged a shell script to remove Usenet headers and
trailers from Executioner converted files...  It should run under any unix..
just follow the instructions...   btw.. you won't really be able to cat
any of te extracted executioner files because the linefeeds which unix
needs arew removed..  anyways.. enjoy..

----- cut here -----
#    REMOVE EVERYTHING ABOVE THIS LINE 
#    SAVE AS stripexec.sh
#    THEN TYPE /bin/sh stripexec.sh
echo extracting file stripexec
cat << '#*\\\THE_END//////*#' > stripexec
#
#  This shell script removes all lines above 'CALL -151' and all
#  lines below 'E00G' in an executioner converted Usenet posting.
#  It also appends 2 linefeeds after 'E00G' and proceeds to convert
#  all linefeeds to carriage returns which apple 2's prefer.  
#  Wildcard filenames are allowed with each extracted file having
#  a '.exec' tail added.  
#  The shell script is a kludge, but it works fine.  
#  Tested with an Apple //c using kermit and xmodem on a microvax
#  running Ultrix 2.0-1.
#  Written by Paul Nakada   This program is free.  Please distribute freely
#

if ($#argv == 0) then
    echo 'usage: stripexec filename'
    exit
endif

foreach file ($argv)
   set newfile=`echo $file .exec | tr -d ' '`
   echo '...stripping header and trailer from' $file '...'
   awk '/CALL/, /E00G/ { print $0 ; if ($0 == "E00G") printf ("\n\n"); }' \
        $file | tr '\012' '\015' > $newfile
end
#*\\\THE_END//////*#
chmod 755 stripexec
echo Done with extraction

---- cut here ----


 __
|     Paul Nakada  '89   #8-)  |                                          
      North House              | ihnp4!think\   nakada@husc4.HARVARD.EDU  
      Harvard College          |       seismo>!harvard!husc4!nakada.UUCP  
      Cambridge, MA  02138     |     rutgers/   nakada@husc4.BITNET       
      617/498-6263 || 7110     |                                         __|