From fb342df1b66897ab17377d6e923049e292149683 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 22 Jun 2009 10:15:07 -0400 Subject: [PATCH] Adjusted catmutt for portability following Mortiz' suggestions. --- xml/catmutt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xml/catmutt b/xml/catmutt index 246bf39..601f14f 100755 --- a/xml/catmutt +++ b/xml/catmutt @@ -43,17 +43,17 @@ trap "rm -f ${TMPFILE}; exit 1" 1 2 3 13 15 cat > "${TMPFILE}" || exit 1 # Now that we've read in the mailbox file, reopen stdin for mutt/user -# interaction. We're not technically in a tty, so use a little hack -# from "greno" at +# interaction. When in a pipe we're not technically in a tty, so use +# a little hack from "greno" at # http://www.linuxforums.org/forum/linux-programming-scripting/98607-bash-stdin-problem.html -tty="/dev/$(ps -p$$ --no-heading | awk '{print $2}')" +tty="/dev/`ps -p$$ --no-heading | awk '{print $2}'`" exec < ${tty} if [ `wc -c "${TMPFILE}" | awk '{print $1}'` -gt 0 ]; then - echo 1>&2 "Calling mutt on mailbox file (${TMPFILE})." + echo 1>&2 "Calling mutt on temporary mailbox file (${TMPFILE})." mutt -R -f "${TMPFILE}" "$@" else echo 1>&2 "Empty mailbox input." fi -rm -f "${TMPFILE}" && echo 1>&2 "Deleted results file (${TMPFILE})." +rm -f "${TMPFILE}" && echo 1>&2 "Deleted temporary mailbox file (${TMPFILE})." -- 2.26.2