On Sunday 31 August 2003 02:31, Marshal Newrock wrote:
> On Sat, 30 Aug 2003, Jason Stubbs wrote:
> > I've found that formail is capable of doing that too. This, however, has
> > brought another problem. I've taken the grep line out of the loop and
> > read the entire message into a variable as follows:
> >
> > message=""
> > while read msg_line
> > do
> > message="${message}${msg_line}\n"
> > done
> >
> > I figured I'd then be able to use the whole message with formail as
> > Yorkshire Dave suggested (and it increases performance too). However, the
> > whitespace at the beginning of multiline headers is being truncated so
> > formail cannot interpret the mail correctly. The only references to
> > whitespace are with regard to IFS but that doesn't seem to have any
> > effect. Is there any other way to turn off this behaviour?
>
> I'm sorry to say, but I think you might have just exceeded the
> capabilities of bash. You can play around with stuff, but it looks like
> bash likes to ditch leading spaces. I think you need to crack open the
> perl man pages or possibly go to temp files from within procmail.
>
> Try this and see:
> $ ls
> $ " ls"
>
> I'm pretty sure that 'read' will also ditch leading spaces, and I don't
> know how to get around that.
Yeah, I tried that too. I take it this is why real programmers often scoff at
bash "programmers". So what're bash scripts good for then? Just automation
with a small amount of primitive conditionals?
Moving to perl won't be too hard, though. I've got all the knowledge I need
now to do the task - thanks to all for that! - and Perl seems to be something
of a mix of Pascal and BASIC, so it shouldn't be too hard.
Once again, thanks to all!
Regards,
Jason
--
[EMAIL PROTECTED] mailing list