TheCivvie wrote to All <=-
I have turned off the Crypto-Gram auto posts for the moment until I
find a way to split the post into 2 or 3 parts
I think I have a solution. I used to use this with the FidoGazette.
This is the script...I think what you want is further down.
#!/bin/bash #####################################################################
## FIDOGAZETTE Posting Script
## By Sean Dennis
##
## Updated on 14 March 2022 at 1820 EDT
##
## This script reads the DOS-formatted text newsletter file, strips
## the formfeed from the top of each page, splits the file into
## individual text files delineated by the page header, then
## posts each text file in order into the FIDOGAZETTE echo using
## mbmsg.
##
#####################################################################
export MBSE_HOME=/opt/mbse
cd $MBSE_HOME/work
FILENAME="fgaz$1$2.nws"
# Prevent PEBCAK error
if [ ! -f $FILENAME ]; then
printf "\n\n"
echo "You need to copy the newsletter into the directory!"
printf "\n\n"
exit 1
fi
# Remove the formfeed control code from each page header
# FF = ^L = 0C (hex)
# -i = do the changes inline putting file into memory to edit
sed -i 's/\x0c//' $FILENAME
# Split file into pages delineated at the top with "FGAZ"
# Pages start at xx00 (actual filename)
csplit -s $FILENAME '/FGAZ/' '{*}'
rm $FILENAME
I=0
# Start posting all of the pages
for file in `ls` ; do
# If digit is < 10, pad with leading zero for csplit's output
printf -v J "%02d" $I
# If it's the title page, use subject w/o page #
if [ $I -eq 0 ]; then
SUBJECT="FidoGazette V$1 I$2"
else
SUBJECT="FidoGazette V$1 I$2 Page $I"
fi
# Call mbmsg to post text file into FIDOGAZETTE echo
$MBSE_ROOT/bin/mbmsg post "All" 113 "$SUBJECT" $MBSE_HOME/work/xx$J - -q
((I++))
done
rm xx*
===
Hope this helps.
-- Sean
... "Lack of money is the root of all evil." - George Bernard Shaw
--- MultiMail/Linux
* Origin: Outpost BBS * Johnson City, TN (618:618/1)