Date:        Wed, 20 Jun 2018 13:34:30 +0100
    From:        Ralph Corderoy <ra...@inputplus.co.uk>
    Message-ID:  <20180620123430.ce31721...@orac.inputplus.co.uk>

  |     /usr/lib/nmh/mhl \
  |         -form <(printf '%s\n' from:decode : body:nocomponent,format) \
  |         -fmtproc true \
  |         `mhpath +foo all`

That's cute, but not at all portable. and fails for me with my slightly old
nmh when "true" fails to read what mhl writes, which leads to SIGPIPE
and an error from mhl, try (with any mods that are appopriate) ...

#! /bin/sh

F=$(mktemp "${TMPDIR:-/tmp}/mhl-$LOGNAME-XXXXXX")
P=$(mktemp "${TMPDIR:-/tmp}/mhl-$LOGNAME-P-XXXXX")
trap 'X=$?; rm -f "$F" "$P"; exit $X' 0 1 2 3 13 15

cat >"$F" <<'EOF'
from:decode
:
body:nocomponent,format
EOF

cat >"$P" <<'EOF'
#! /bin/sh
sed -e d
EOF
chmod +x "$P"

$(mhparam libexecdir)/mhl -form "$F" -fmtproc "$P" $(mhpath "$@")



-- 
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to