Re: Extract last email from an email file (mbox format)
udi M <[email protected]> Wed, 25 May 2016 16:11:13 +0300
| Newsgroups | gmane.mail.procmail |
|---|---|
| Organization | tau |
| Message-ID | <[email protected]> |
On 25/05/16 16:06, Julian H. Stacey wrote:
> udi M wrote:
>>
>> On 25/05/16 09:12, Xu Wang wrote:
>>> Hi how can I efficiently extract the last email in a huge mbox email file?
>>
>> tac thaBigBox | sed -n -e '1,/^From /p' | tac
> tac: Command not found.
I work on Linuxs and tac(1) is like cat(1) but print the file in
reverse. I do not
know BSD but try
apropos reverse or man -k reverse
to find the command.
Anyway, my next answer using formail(1) is better and safety
--udi
> URL ?
>
> uname -a
> FreeBSD lapr.js.berklix.net 11.0-CURRENT FreeBSD 11.0-CURRENT
> #10 r300601M: Wed May 25 07:11:11 CEST 2016
> [email protected]:/data/release/11.0-CURRENT/usr/obj/usr/src/sys/GENERIC
> amd64
> cd /usr/ports; cd */tac
> */tac: No match.
>
> Cheers,
> Julian
> --
> Julian Stacey, BSD Linux Unix Sys Eng Consultant Munich http://berklix.eu/jhs/
> Mail plain text, No quoted-printable, HTML, base64, MS.doc.
> Prefix old lines '> ' Reply below old, like play script. Break lines by 80.
> Britain denies 700,000+ Brits in EU a vote. http://www.berklix.eu/brexit/