Novice in shell scripting - generating report


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Novice in shell scripting - generating report
# 1  
Old 04-27-2012
Generating report with clauses in a string that is searched

Hi I recently joined a project where I have been asked to generate a report using shell script accessing UNIX box.
I have no idea on how to do it as I am a beginner and learning shell scripts.

Suppose I have a XML:
Code:
<XYZRequest>
<effectiveDate>someDate</effectiveDate>
<expiryDate>someDate</expiryDate>
<reason>blahblah</reason>.....</XYZRequest>

This XML will be in one of the logs. I need to search for the element XYZ in logs and then check inside the XML for effectiveDate in the past and expiryDate as currentDate and if the condition succeeds check for the response <XYZResponse> in the logs and check if there is any error inside the elements say for example <XYZResponse><Solution>Error</Solution></XYZResponse>.

If there is any entry in logs with Error, generate a report with the details if not generate a report saying no issues. Can someone pls help me.Smilie

Moderator's Comments:
Mod Comment Please use next time code tags for your code and data

Last edited by vbe; 04-27-2012 at 08:58 AM..
# 2  
Old 04-27-2012
This is a duplicate of https://www.unix.com/shell-programmin...onditions.html, and should be deleted/ignored.
This User Gave Thanks to ThomasMcA For This Post:
# 3  
Old 04-27-2012
Double post, please continue here:

https://www.unix.com/shell-programmin...onditions.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparing two files and generating the report

Hi All, What am trying to do is generate the report by compating two files. File A ----------- 111 22222 3333 222 55555 7777 File B ----------- 11A 22222 3333 333 55555 7778 Now the report should be as follows Added: 333 55555 7778 Removed: (6 Replies)
Discussion started by: Prashantckc
6 Replies

2. Shell Programming and Scripting

generating report in Excel(Open office) using shell scripting

Hello All, I need to execute around 15 queries after which all data should come in Excel format. Executing 15 queries is not a problem. Problem is how to present/put data in excel. kindly suggest me how to start, what to study or what should i do. thanks, (1 Reply)
Discussion started by: shubham8787
1 Replies

3. Shell Programming and Scripting

Generating a count report

Hi, I want to generate a report for count mismatching. Steps followed for creating a script for file in 1). I have to fetch the file name from the checksum.out #customer_information_ 2). Added Detail #customer_information_Detail 3). Check the file exist or not. 3.1.1)if the the file... (1 Reply)
Discussion started by: number10
1 Replies

4. Shell Programming and Scripting

[bash scripting] Generating a table with aligned fields

Hi everyone, I want to write a function which calculates the space needed between fields, to generate a table with aligned fields, like when you type "ls -l", the operating system generates a table with beautifully aligned fields. I've got this code so far: for line in $(cat tmpSearch)... (2 Replies)
Discussion started by: Aveltium
2 Replies

5. Shell Programming and Scripting

Awk Script for generating a report

Hi all, I have a log file of the below format. 20081016:000042 asdflasjdf asljfljs asdflasjf safjl 20081016:000229 /lask/ajlsdf/askdfjsa 20081016:000229 /lashflas /askdfaslj hsfhsahf 20081016:000304 lasflasj ashfashd 20081016:000304 lajfasdf ashfashdfhs I need to generate a... (3 Replies)
Discussion started by: manoj.naidu
3 Replies

6. Shell Programming and Scripting

Parsing out the logs and generating report

My file will contain following(log.txt): start testcase: config loading ...... error XXXX ..... end testcase: config loading, result failed start testcase: ping check ..... error ZZZZZ ..... error AAAAA end testcase: Ping check, result failed I am expecting below output. ... (4 Replies)
Discussion started by: shellscripter
4 Replies

7. Shell Programming and Scripting

Generating a report -Formatted printing -Urgent

Hi, My aim is to generate a report using shell script. There are various formats fields coloumns etc. I want to print in a single line (row) but in different coloumn as given below: field1 field2 field3 field4 ....... ....... ...... ....... The spacing... (1 Reply)
Discussion started by: jisha
1 Replies

8. Shell Programming and Scripting

Unix Shell Novice - File Manipulation

Hi, I am brand new to unix and am hoping someone can start me in the right direction. I want to be able to put the results of a file command such as wc -l filename into a variable which I can then use to test against another variable...i.e. I need to show the nth line of a file, but need to... (3 Replies)
Discussion started by: nmullane
3 Replies

9. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

10. Shell Programming and Scripting

Unix scripting-Need help-NOVICE -PLEASE HELP

I really want to get into unix scripting,work with RS6000 -AIX. How do i get started,what books are good for beginners,i am very desperate I have no programming background but ready to scrafice all my time in learning .please help. PLEASE,PLEASE PLEASE ,HELP.... Any advice will realy... (2 Replies)
Discussion started by: Ghanaman
2 Replies
Login or Register to Ask a Question