Computing.Net > Forums > Unix > unix script to search for a decimal

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

unix script to search for a decimal

Reply to Message Icon

Name: cesar_NZ
Date: September 30, 2008 at 20:07:57 Pacific
OS: Solaris
CPU/Ram: na
Product: na
Comment:

hi all,
i wanted to write a shell script (#!/bin/ksh) to search through log files and print out lines which contain "long decimals" e.g 56.879999999999995. I also wanted to print out the filename.
i have managed to get the filename to print out but not sure on how to search for long decimals, any help would be much appreciated.

thanks in advance.



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: September 30, 2008 at 21:50:46 Pacific
Reply:


egrep -ol "[0-9][0-9]+\.[0-9]+" file


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: unix script to search for a decimal

shell script to check for a file on www.computing.net/answers/unix/shell-script-to-check-for-a-file-on/3714.html

Script to extract a word from file www.computing.net/answers/unix/script-to-extract-a-word-from-file/8081.html

I need a shell-script to search www.computing.net/answers/unix/i-need-a-shellscript-to-search/5941.html