Orphaned Response
ajs
ajs at hpfcla.UUCP
Wed Apr 17 10:57:00 AEST 1985
> Is this a special command, or do people just painstakingly
> insert the > sign in front of mail read into the buffer?
For short text it's easy to insert. For longer text, it's not hard to
write a filter and pass the text through it from vi (or your favorite
smart-enough editor). For example, using the adjust(1) program (to be
supported on the next HPUX release), this little filter formats the
"quoted" text and inserts the brokets:
----------
# Script to format a mail response or a C comment block from the editor.
# Usage: <script> [arguments]
# If invoked as "adjcomm", does a comment block, else does a response block.
# Any arguments are passed to adjust, including filenames.
# If any filenames are given, adjust reads them instead of stdin, which
# bypasses the left-alignment done first.
# Formats the text and puts a "> " or " *" in front of each line.
tab=' '
if [ "$0" = adjcomm ]
then
indent=" *"
script='s/^ \*//' # remove leading " *".
else
indent="> "
script="s/^[ $tab]*//" # remove leading whitespace.
fi
sed "$script" | # always read stdin.
adjust $* | # read files if told to do so.
sed "s/^/$indent/"
---------
Alan Silverstein, Hewlett-Packard Fort Collins Systems Division, Colorado
{ihnp4 | hplabs}!hpfcla!ajs, 303-226-3800 x3053, N 40 31'31" W 105 00'43"
More information about the Comp.unix
mailing list