Quote:
Originally posted by photon
grep will not do it, because you need to store values.
Try Perl.
This code should print output such as.
Line: 344 Content: dasdjasdjoasjdoasjdoa SYN dakspodkapsdka
Line: 345 Content:asdasdasdasdasdasdasd SYN sdfsdfsdfsdfdf
Line: 346 Content:asdasdasdasdasdasdasd SYN sdfsdfsdfsdfdf
Dude, you have 3 lines!
just a couple of comments on the code if you dont mind.
1) dont use html. (unless you want to display it on a web page. in that case i would opt to make it a cgi and be able to run it on demand via the web.
2) the code as is does not work. your missing a double quote and a semicolon.
3) you will only get lines 1,2,3 not 4,5,6 and so on down the file. just an FYI. remember your resetting $count almost everytime.
4) instead of $count == 3 its prolly better to do a catch and and say ($count => 3) you never know if there can be more then 3.
5) remove the first print. so only the >=3 SYN lines print.
other wise pretty cool man. niCe job.
*Perderabo is my ksh hero