grep file

Greg Bradner gregb at rhythm.com
Wed Apr 14 13:24:53 UTC 2004


egrep

Steve Buehler wrote:

> Not sure what mailing list I need to join to ask this question, so I 
> will ask it here in the hopes of getting a good response.  I am trying 
> to get a specific line out of a file that changes size regularly using 
> a shell script (#!/bin/sh).  I use the following command:
> /bin/cat $BACKUPLOG|grep "Downloaded: ">>$BACKUPLOG'2'
> Of course $BACKUPLOG and $BACKUPLOG'2' refer to a couple of files.  
> For some reason, it will pull out lines that are NOT part of the line 
> that has "Downloaded: " in it.  The other lines do have the word 
> "Downloaded" in them, but not the colon and space after it.  I was 
> wondering if it would be easier to tell it just to cat the 2nd line 
> from the end of the file.  That is where the line is always at.  
> Problem is, I do not know how to do this.  I hope that someone has an 
> idea on this and would be kind enough to send me the correction.
>
> Thanks
> Steve
>
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rhythm & Hues
5404 Jandy Place
Los Angeles, CA 90066
Voice: 310 448-7763
Fax:   310 448-7600
gregb at rhythm.com






More information about the redhat-list mailing list