[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading envelope in process.cf



On Thu, May 08, 2003 at 03:17:12PM +0200, Marek Kowal wrote:
...
> Ok, I'll ask our sysadmin to install the patch ASAP and let you know.

Now there is tested code which does not eat huge amounts of memory,
and is even plain enough to understand.  Had to add a bit internal
IO redirection magic, but that should be all right (speedwise.)

It will definitely consume memory only one line at the time, and
does handle IFS controlled splitting into multiple variables.
("man sh" will tell you all about "IFS")

The code you have in mind is best served by something like:

	while read tag rest
	do
		case "$tag" in
		env-end)
			break
			;;
		to)
			ssift "$rest" in
			<(.*)@(.*)>
				...
				;
			tfiss
			;;
		esac
	done < $file

Which does the tag/rest IFS splitting in internal C code of the sh_read().

> Cheers,
> Marek
-- 
/Matti Aarnio	<mea@nic.funet.fi>
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi