Re: grep file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx



--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux