[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nmh-workers] mhshow and Headers
From: |
Robert Elz |
Subject: |
Re: [nmh-workers] mhshow and Headers |
Date: |
Wed, 20 Jun 2018 22:18:42 +0700 |
Date: Wed, 20 Jun 2018 13:34:30 +0100
From: Ralph Corderoy <address@hidden>
Message-ID: <address@hidden>
| /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 "$@")