LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] auto mail reformat

[ILUG] auto mail reformat

Padraig Brady padraig at antefacto.com
Mon Mar 4 16:47:08 GMT 2002


Gavin McCullagh wrote:
> 
> Surely this is not *reliably* possible?
> 
> ie if you have 
> 
> 
>> > little
>>
> 
> isn't just another person commenting later in the thread?
> 
> Obviously you could get a line which appears in between two lines of the
> same thread and merge it in (no matter how compilcated the implementation).  
> Is that what you want though?  It could really bugger up some complex threads 
> on you.
> 
> Gavin

I suppose you can't do this generally,
the best you could do is select lines
manually that you know are from the
same response and pass this through a filter
giving the number of >> to prepend and the
total width of the text. There is then the
issue of valid > being removed from the text,
but I could live with that.

How about the following:

#!/bin/sh

if [ $# != 2 ]; then
     echo "Usage: $0 reponse_level(starting at 0) line_width"
     exit
fi

RESPONSE_LEVEL=$1
TEXT_WIDTH=`expr $2 - $1 \* 2`

curr_level=0
while [ 1 ];do
     if [ $curr_level -eq $RESPONSE_LEVEL ]; then
         break;
     fi

     RESPONSE_DELIM="$RESPONSE_DELIM> "

     curr_level=`expr $curr_level + 1`
done

tr -ds '>\n' ' ' | fmt -w$TEXT_WIDTH | sed -e "s/^[ 
]*\(.*\)/$RESPONSE_DELIM\1/"






More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell