On Sun, 08 Oct 2006 16:16:30 +0000, Jack Cuyler wrote: > On Sun, 08 Oct 2006 16:00:17 +0000, Jack Cuyler wrote: > >> This patch will strip out the sig and add it back in at the end (although >> the latter part is commented out, as I'm not sure if that will break >> anything) > > And looks like I found a typo. Two, actually. > >> +sed -n -e '1,/-- /p' ${TEMPFILE} |\ >> +grep -v ^'-- ' > ${BODYFILE} > > The regex should have a ^ in there, like so:
Thinking it over a bit more, the regexes should probably have a $ in there, too, so lines like: -- something here don't match. Also, there's really no need for the grep -v if the proper sed statement is used. Me and my hasty posting. Anyhoo, here's the revised patch. --- pan-atach-kd.orig 2006-10-08 11:44:50.000000000 -0400 +++ pan-atach-kd 2006-10-08 15:09:16.000000000 -0400 @@ -8,6 +8,8 @@ NAME="pan-attach-kd" VERSION="0.0.2006.10.07.0" BODYFILE=${1:--h} +TMP=${TMP:-/tmp} +TEMPFILE=${TMP}/panpost.$(date +%Y%m%d%H%M%S%N) ################################################################################ # description and help @@ -121,10 +123,20 @@ ################################################################################ # OK, we know the attach file is readable, and we know what encoding to use, so... +# Copy the inital text to the temp file +cat ${BODYFILE} > ${TEMPFILE} + +# Strip out the sig and overwrite the body +sed '/^-- $/,//d' ${TEMPFILE} > ${BODYFILE} + echo >> ${BODYFILE} echo >> ${BODYFILE} uuenview -${ENCODE} ${ATFILE} >> ${BODYFILE} +# Uncomment the next 2 lines to add the sig back in +#echo >> ${BODYFILE} +#sed -n -e '/^-- $/,//p' ${TEMPFILE} >> ${BODYFILE} +rm ${TEMPFILE} ################################################################################ # debugging aids #konsole --noclose --nohist -e echo $ -- Cheers, Jack SPITWADS ARE NOT FREE SPEECH SPITWADS ARE NOT FREE SPEECH SPITWADS ARE NOT FREE SPEECH SPITWADS ARE NOT FREE SPEECH Bart Simpson on chalkboard in episode 8F01 _______________________________________________ Pan-users mailing list Pan-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/pan-users