bindir=`finddir $0`
nmhbindir=`cd "$bindir" && pwd`
+if printf 'OK\n' | tail -n 1 2>&1 | grep OK >/dev/null; then
+ tail='tail -n'
+else
+ tail='tail -'
+fi
#### Checks for missing mandatory arguments.
#### It's not strictly necessary to have one space after
#### the : that separates the header field name from the
#### body, but do it to avoid surprising someone.
- add=`printf %s "$arg" | sed -e 's/:/: /' -e 's/: /: /'`
+ #### Solaris sed wants the trailing newline in its input.
+ add=`printf '%s\n' "$arg" | sed -e 's/:/: /' -e 's/: /: /'`
headerfieldlist="${headerfieldlist:+$headerfieldlist}$add
"
headerfieldarg=0
fi
#### Add trailing newline to body if it doesn't have one.
- if [ `tail -n 1 "$message_file" | wc -l` -ne 1 ]; then
+ if [ `${tail}1 "$message_file" | wc -l` -ne 1 ]; then
printf '\n' >>"$message_file" || exit 2
fi
else
#### Add trailing newline to body if it doesn't have one.
- [ `printf %s "$body" | tail -n 1 | wc -l` -ne 1 ] && body="$body
+ [ `printf %s "$body" | ${tail}1 | wc -l` -ne 1 ] && body="$body
"
if [ "$tmpfileresent" ]; then