Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a bash script 1

Status
Not open for further replies.

sco21

Technical User
May 20, 2002
67
0
0
GR
I want some help to make a script
this is my log file

2003-01-29 23:20:02 24138915 4841823
2003-01-29 23:25:02 23023245 4179976
2003-01-29 23:30:01 50114161 3065804
2003-01-29 23:35:01 24771375 3501016
2003-01-29 23:40:01 27893795 4199491
2003-01-29 23:45:01 26523593 3705775
2003-01-29 23:50:01 23440011 3372306
2003-01-29 23:55:01 23125174 4037042
2003-01-30 00:00:02 24366334 3715173
2003-01-30 00:05:01 26824279 3663193
2003-01-30 00:10:01 28317816 4285886
2003-01-30 00:15:01 28170460 6281458
2003-01-30 00:20:01 25076290 3312461
2003-01-30 00:25:01 27465629 3989601
........
........
........
How can I parse this file with a bash script
and give as arguments two dates

exm. script 2003-01-29 2003-01-30

and the output to give me only this range of two dates from the file


THANKS
 
Hi,
egrep "2003-01-29|2003-01-30" YourLogFile

Boris

 
boria, this will only work if the file is sorted :(
try
sed -ne '/2003-01-29/,/2003-01-30/p' filename -----------
Ohne Intelligenz bist Du ein Fiasko,
ohne Technik ein Amateur und
ohne Herz eine Maschine.

[ Wladimir Horowitz ]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top