Solved

big tarfiles to lex

Posted on 1997-12-01
2
207 Views
Last Modified: 2010-04-21
I've very big tar-files with eMails in it.
My lex-Programm should work with the content of these files.
The Problem: When I pipe it to lex like this:
more tarfile | lexprogram >output
it ends with a broken pipe.
When I try it like this
lexprogram <tarfile >output
the program will abbort after the same time (I guess yywrap stopps the program).
0
Comment
Question by:bodirsky
2 Comments
 

Expert Comment

by:xilef
ID: 2008170
Hm, shouldn't you first extract your tarfile?

Something like:
cd /tmp/mydir
tar -xf /path/to/my/tarfile.tar
cat * | lexprogram

(The last line should probably be a loop for each of the files if there are really MANY files. The loop depends on the shell).

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 2008171
tar files contain null bytes (0x0). Most lex flaviours treat this as an EOF. Your must take care for them before the default action (.)
Check your lex manual, or switch over to flex (which can handle null bytes ;-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now