From: W. Trevor King Date: Mon, 22 Jun 2009 14:15:07 +0000 (-0400) Subject: Adjusted catmutt for portability following Mortiz' suggestions. X-Git-Tag: 1.0.0~71^2~6^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fb342df1b66897ab17377d6e923049e292149683;p=be.git Adjusted catmutt for portability following Mortiz' suggestions. --- 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})."