auto-print prints the blank line when doing:
$SED -e '1,/^$/q'
The blank line doesn't play well when we are trying to compose e-mail
headers.
To use the q, we have to suppress the default auto-printing, and then
include a print command "p", like:
$SED -n -e '[...];p'
This patch does that in the e-mail functions, so we now work on SCO as well.
Tested on Linux (GNU Awk), Solaris, and SCO OpenServer.
# First we take the top part of the e-mail for headers
# Excluding any "Content-" lines, which need to stay with
# the actual template content
- $SED -e '/^$/Q' $1 \
+ $SED -n -e '/^$/q;p' $1 \
| $GREP -v ^Content \
| template
| template
echo ""
- body_encoding=`$SED -e '/^$/Q' $1 \
+ body_encoding=`$SED -n -e '/^$/q;p' $1 \
| $GREP -i ^Content-Transfer-Encoding \
| template \
| $SED -e 's/^[^ ]*: *//'`;
test "$body_encoding" || body_encoding=7bit;
- $SED -e '1,/^$/d' $1 | template > $TMPDIR/body.txt
+ $SED -n -e '1,/^$/d;p' $1 | template > $TMPDIR/body.txt
mimeEncode $TMPDIR/body.txt $body_encoding
if [ -n "$2" ]; then