Article View: comp.mail.misc
Article #4382Re: UCB Mail with reply include
From: ken
Date: Sun, 13 Sep 1987 01:13
Date: Sun, 13 Sep 1987 01:13
99 lines
2951 bytes
2951 bytes
Here are a couple of short shell scripts for MH. The first I call
"current". Inside the editor, vi for me, I say :r !current and the
body of the message is read in with >'s prefixing each line. I forget
who wrote this and posted to the MH users group.
I wrote the second one. I call it appvi and appex (links to same
file). From whatnow, I can say "e appvi file" or "e appvi !command",
and it reads in the file or the output of command and then drops me
into vi or ex. Of course, command is often "current".
Have fun, Ken
#!/bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #!/bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# current
# appvi
# This archive created: Sat Sep 12 21:10:27 1987
# By: Ken Yap ()
export PATH; PATH=/bin:$PATH
echo shar: extracting "'current'" '(214 characters)'
if test -f 'current'
then
echo shar: over-writing existing file "'current'"
fi
cat << \SHAR_EOF > 'current'
#! /bin/sh
: read in the current message, rn-style
LINK="@"
# Skip headers, then print out the body lines prepended with "> "
sed -n '
:header
/^$/b eohdr
n
b header
:eohdr
n
b body
:body
s/^/> /p
n
b body' $LINK
SHAR_EOF
if test 214 -ne "`wc -c 'current'`"
then
echo shar: error transmitting "'current'" '(should have been 214 characters)'
fi
chmod +x 'current'
echo shar: extracting "'appvi'" '(436 characters)'
if test -f 'appvi'
then
echo shar: over-writing existing file "'appvi'"
fi
cat << \SHAR_EOF > 'appvi'
#! /bin/sh
case $0 in
*vi)
editor=${VISUAL-/usr/ucb/vi}
;;
*ed)
editor=${EDITOR-/usr/ucb/ex}
;;
esac
case $# in
1)
break
;;
*)
i=1
for arg
do
case $i in
$#) ;;
*) arguments="$arguments $arg" ;;
esac
i=`expr $i + 1`
done
case $arguments in
" !"*)
arguments=`expr "$arguments" : ' !\(.*\)'`
${SHELL-/bin/sh} -c "$arguments" >> $mhdraft
;;
*)
cat $arguments >> $mhdraft
;;
esac
esac
exec $editor $mhdraft
SHAR_EOF
if test 436 -ne "`wc -c 'appvi'`"
then
echo shar: error transmitting "'appvi'" '(should have been 436 characters)'
fi
chmod +x 'appvi'
# End of shell archive
exit 0
Technical Details
Message-ID:
<2178@sol.ARPA>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!rochester!kenReferences:
<1392@bloom-beacon.MIT.EDU> <890@bakerst.UUCP> <1053@moscom.UUCP> <773@hplabsz.HPL.HP.COM>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!rochester!ken From: ken@rochester.UUCP Newsgroups: comp.mail.misc,comp.sources.wanted,comp.unix.questions Subject: Re: UCB Mail with reply include Message-ID: <2178@sol.ARPA> Date: Sat, 12-Sep-87 21:13:26 EDT Article-I.D.: sol.2178 Posted: Sat Sep 12 21:13:26 1987 Date-Received: Sun, 13-Sep-87 10:14:50 EDT References: <1392@bloom-beacon.MIT.EDU> <890@bakerst.UUCP> <1053@moscom.UUCP> <773@hplabsz.HPL.HP.COM> Reply-To: ken@cs.rochester.edu (Ken Yap) Distribution: world Organization: U of Rochester, CS Dept, Rochester, NY Lines: 99 Keywords: mail replies, mailx, inclusion, cute little whatevers