Random ...
 
December 2017
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Tags ...
Links



Linux++:::: clq: tail-ing a file
Posted at 06.Apr,2007 21:52  Comments 0 / Trackbacks 0 / Like this post!
Technorati tag(s):

I kept seeing this message in my logfile.:

 Error indexing mbox file /home/xx/mail//sent-mail: LF not found where expected 

It looks like there's a problem with dovecot or imp or the conversion from openwebmail to imp.

The problem was caused by a blank first line. I know, I know, use maildir. Later, maybe.

Back to the story. So, I need to chop off that first line. what's the best way to do it?

We can do it in python, perl, c, etc, but I wanted an easy and effective solution.

tail comes to the rescue. If we use the -c option, we can specify how much to tail.

Let's see, if the file is 12345 bytes,:

  tail -c 12344 file > out

would get rid of the first line.

Any other suggestions?


Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/127/tbping 

Comments
Post a comment