Dear friends
I have a file which is something like this
21/Feb/2013:15:25:54 changelogs.ubuntu.com
21/Feb/2013:15:27:48 ocsp.verisign.com
21/Feb/2013:15:27:48 ocsp.verisign.com
21/Feb/2013:15:27:49 ocsp.verisign.com
21/Feb/2013:15:27:49 ocsp.verisign.com
21/Feb/2013:15:27:54 www.google.co.in
21/Feb/2013:15:27:56 translate.google.co.in
21/Feb/2013:15:27:56 humanlinux.blogspot.in
21/Feb/2013:15:27:56 s0.cyberciti.org
21/Feb/2013:15:27:56 assets.hostedtube.com
21/Feb/2013:15:27:56 www.google.co.in
21/Feb/2013:15:27:56 www.google.co.in
21/Feb/2013:15:27:56 www.google.co.in
21/Feb/2013:15:27:57 www.google.co.in
22/Feb/2013:15:31:50 pagead2.googlesyndication.com
22/Feb/2013:15:31:51 images.hostedtube.com
22/Feb/2013:15:31:51 images.hostedtube.com
22/Feb/2013:15:31:53 images.hostedtube.com
22/Feb/2013:15:31:55 images.hostedtube.com
22/Feb/2013:15:31:56 images.hostedtube.com
22/Feb/2013:15:31:56 images.hostedtube.com
Now I want to make a script which ask from use a starting date and a ending date like say starting date is 21/Feb/2013 and ending date is 25/feb/2013
after geting data from user script should fetch data from the file and display on screen.
if it normal then ok if that data matches the line then it can be but the problem is this that script should match that if user give the date which is not available in the file
then script should use the very next date and if next date is not available then script should use next to next date and so on..............
and same if the last date is not available then same script should use just previous date.\
can I make this in bash then please help me
thanks ....
I have a file which is something like this
21/Feb/2013:15:25:54 changelogs.ubuntu.com
21/Feb/2013:15:27:48 ocsp.verisign.com
21/Feb/2013:15:27:48 ocsp.verisign.com
21/Feb/2013:15:27:49 ocsp.verisign.com
21/Feb/2013:15:27:49 ocsp.verisign.com
21/Feb/2013:15:27:54 www.google.co.in
21/Feb/2013:15:27:56 translate.google.co.in
21/Feb/2013:15:27:56 humanlinux.blogspot.in
21/Feb/2013:15:27:56 s0.cyberciti.org
21/Feb/2013:15:27:56 assets.hostedtube.com
21/Feb/2013:15:27:56 www.google.co.in
21/Feb/2013:15:27:56 www.google.co.in
21/Feb/2013:15:27:56 www.google.co.in
21/Feb/2013:15:27:57 www.google.co.in
22/Feb/2013:15:31:50 pagead2.googlesyndication.com
22/Feb/2013:15:31:51 images.hostedtube.com
22/Feb/2013:15:31:51 images.hostedtube.com
22/Feb/2013:15:31:53 images.hostedtube.com
22/Feb/2013:15:31:55 images.hostedtube.com
22/Feb/2013:15:31:56 images.hostedtube.com
22/Feb/2013:15:31:56 images.hostedtube.com
Now I want to make a script which ask from use a starting date and a ending date like say starting date is 21/Feb/2013 and ending date is 25/feb/2013
after geting data from user script should fetch data from the file and display on screen.
if it normal then ok if that data matches the line then it can be but the problem is this that script should match that if user give the date which is not available in the file
then script should use the very next date and if next date is not available then script should use next to next date and so on..............
and same if the last date is not available then same script should use just previous date.\
can I make this in bash then please help me
thanks ....
Comment