[GRLUG] Bash memory <?> problem

Jeff DeFouw mrj at plorb.com
Thu Jan 12 13:39:23 EST 2012


On Thu, Jan 12, 2012 at 09:53:46AM -0600, L. V. Lammert wrote:
> Trying to extract emails from an archive using a variation on
> "Simple but Perfect" mbox to Maildir converter, .. the script is
> choking on the 3rd message:
> 
> # ./extract_email rhart < $(zcat mail_backup-20120101.tar.gz)
> -bash: xrealloc: ../subst.c:4489: cannot reallocate 268435456 bytes
> (0 bytes allocated)
> 
> Seems to be some sort of memory issue? The system is a Mandrake from
> 2008, .. Perl is 5.8.8.
> 
> Anyone have a suggestion on how to isolate the problem?

With $() you are asking bash to load every word in the mail archive, 
convert the words to a list of parameters on the command line, and then 
use < to try to use the long list of words as an input file (which would 
give you a different error later).  I'm pretty sure that's not what you 
want.  Use a pipe to send the output of one program to another:

zcat mail_backup-20120101.tar.gz | ./extract_email rhart

-- 
Jeff DeFouw <mrj at plorb.com>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the grlug mailing list