Need help resolve this complex senario


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help resolve this complex senario
# 1  
Old 12-23-2013
Need help resolve this complex senario

Hi,

I wish to take "number of days" as input from the user and default it to 1 if not specified.

Then i need ls -ltr *.csv and select only those files which are "number of days old i.e 1 is for yesterdays.

This may result in n files as output.

with 1 of the n files selected [using any loop] i need to grep "yellow" output.log output of which will look like

Quote:
Log Process 1 005b:0 2013-12-19 13:21:14 ebill 369 -02011 Process 369 error - Process yellow (PPoE)
and many such results. Here 2013-12-19 13:21:14 is the timestamp in the output.log.

I need to consider only those results in the grep's output that fall +/-4 mins than the time stamp of the .csv file and store "Process" "-02011" in bash variables.

Please let me know if you need more info.

Thank you very much!!

Last edited by mohtashims; 12-23-2013 at 06:50 AM..
# 2  
Old 12-23-2013
Bumping up or cross posting is not allowed in forum, please read forum rules.

Find a string in file 5 days ago | Unix Linux Forums | Shell Programming and Scripting
# 3  
Old 12-23-2013
Quote:
Originally Posted by Akshay Hegde
Bumping up or cross posting is not allowed in forum, please read forum rules.

Find a string in file 5 days ago | Unix Linux Forums | Shell Programming and Scripting
This is a seperate query altogether. There is nothing in common between my previous post and this one. How is it even related to bumping or cross posting ?

Last edited by mohtashims; 12-23-2013 at 07:46 AM..
# 4  
Old 01-08-2014
bump ....
# 5  
Old 01-08-2014
So a few questions:-
  • What have you tried so far?
  • Do you have some sample code that is not quite working?
  • Do you have some sample input and required output?
  • Have you looked at the manual pages for find and grep?

Most importantly, What have you tried so far?

I could suggest a few things, but it would be better for your learning to try and we can make suggestions.



Robin
Liverpool/Blackburn
UK
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Red Hat

Could not resolve ip through DNS

Dear all , Very recently our DNS server ip got changed. I have entered the DNS ip in /etc/resolv.conf ...but I could not resolv it for my ip address. Verified that , the IP is added in the DNS also. It is still working with the old DNS ip. Please let me know what could be... (11 Replies)
Discussion started by: jegaraman
11 Replies

2. Shell Programming and Scripting

Please help to resolve the below script

Dear Members, Please help me to resolve below script. The script is used to send the attachment in the mail with all the details. However in one of the incidents, the attachment in the mail was blank. Now the client is after me to get it resolved ASAP. So prompt response would be highly... (2 Replies)
Discussion started by: SKO_TC
2 Replies

3. UNIX for Dummies Questions & Answers

Resolve IP to Hostname?

Good day, I would like to resolve IP's to Hostnames using Putty. I'm using Mandriva Linux 2008.0. Is this possible? Perhaps with nmap? (13 Replies)
Discussion started by: McGuywer
13 Replies

4. UNIX for Dummies Questions & Answers

Please resolve it

#!/bin/sh# 'clear'for i in $(seq -w 15 37)doecho $iecho The content in ZZ=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp`echo $ZA="Connection timed out."echo The content in Aecho $Aexpr "$A" : '..\(...\)'echo $Adone Hi,Please see the above program. The above... (9 Replies)
Discussion started by: veerumahanthi41
9 Replies

5. Shell Programming and Scripting

please resolve the below problem

#!/bin/sh # 'clear' for i in $(seq -w 15 37) do echo $i echo The content in Z Z=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.com:8000/webcore/test/test.jsp` echo $Z A="Connection timed out." echo The content in A echo $A expr "$A" : '..\(...\)' echo $A done ... (1 Reply)
Discussion started by: veerumahanthi41
1 Replies

6. Shell Programming and Scripting

Resolve a Variable

Hi I have a variable which is a path ie: UBERROR=/cobwrk/mchr/prodsup/ub/wrk/../error is there anyway I can get the output of an echo to read: #echo $UBERROR /cobwrk/mchr/prodsup/ub/error instead of #echo $UBERROR /cobwrk/mchr/prodsup/ub/wrk/../error Many thanks! (2 Replies)
Discussion started by: serm
2 Replies

7. UNIX for Dummies Questions & Answers

how do u resolve this????

Please help me on how to resolve: 1-unresponsive terminals 2-unresponsive applications 3-how to interrupt processe p.s unix/linux OS (1 Reply)
Discussion started by: zizu
1 Replies

8. IP Networking

Cannot Resolve Host Name

I am running LexMark MarkNetPro-3 print servers on my AIX network. All of the sudden, none of my printers will print anymore. I am getting an error message on the console: Unable to resolve host name. This message comes up everytime a user submits a print job. Any Ideas? (1 Reply)
Discussion started by: Docboyeee
1 Replies
Login or Register to Ask a Question