LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to grep similar lines in bash? (http://www.linuxquestions.org/questions/linux-software-2/how-to-grep-similar-lines-in-bash-388806/)

bruno buys 12-02-2005 10:40 PM

How to grep similar lines in bash?
 
I'm scripting the creation of an exif text file, with info from images. The problem is, I need to collect date info from very similar lines. See below:

bruno@frank:~/D70s/20051202$ cat eteste
File Modification Date/Time : 2005:11:25 23:09:40
Date/Time Of Last Modification : 2005:11:25 22:09:38
Date/Time Of Digitization : 2005:11:25 22:09:38
Shooting Date/Time : 2005:11:25 22:09:38
Shooting Date/Time : 2005:11:25 22:09:38.10

How do I pick the last line, which has fractions of seconds info?

thanks!

homey 12-02-2005 10:55 PM

How about something like this...
Code:

grep [.] file.txt

bruno buys 12-02-2005 11:56 PM

I was doing
cat eteste|tail -n 1

your grep with regexp worked, as well. Thanks.

Its nice to have options.


All times are GMT -5. The time now is 03:55 PM.