Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

big tarfiles to lex

Posted on 1997-12-01
2
Medium Priority
?
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

636 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