how to selectively print version numbers from log files
I have a series of log files in which I want to print version numbers (a.b.c.d) where a,b,c,d are integers. Once I find the pertinent line, is there a way to only print the version number from that line?
For example:
inputs:
2007-04-21 version 5.6.7.4 loading
Version 3.2.3.4 application
outputs:
5.6.7.4
3.2.3.4
I could use cut and sed but from the above examples the inputs are not consistent. I was looking for a more elegant way.
|