Sponsored Content
Top Forums Shell Programming and Scripting Displaying log file pattern output in tabular form output Post 302764145 by Optimus81 on Friday 1st of February 2013 02:59:49 AM
Old 02-01-2013
Thanks bipinajith.

I add line to handle conditions properly but somehow it takes the No Result count as 3 though it should be 1 (point 9, this should be in No Result count since there is no Passed/Failed string).

more over, for Failed count, it shows 3 instead of 5 this is where am getting confused. why is it missing to count another 2 as Failed status. Is that because of (point 4 and 5 , which is out of line)

Code:
if(s=="Passed") ++p; if(s=="Failed") ++f; if((s!="Passed")&& (s!="Failed")||(s=="") ) ++n;


ouput we get now is :
Code:
root@OPT # ./output.sh
|========================================|
|        Consolidated Report Status      |
|========================================|
|   SI No     CHECKS           STATUS    |
|========================================|
|------------------------------------------|
| 1). Interface Checking  : Passed   |
|------------------------------------------|
|------------------------------------------|
| 2). OS version Checking  : Passed   |
|------------------------------------------|
|------------------------------------------|
| 3). Comp running check  : Failed   |
|------------------------------------------|
|------------------------------------------|
| 4). Verify Server Connection, for ADD/ZDZ/IDD components  :           Failed   |
|------------------------------------------|
|------------------------------------------|
| 5). Verify Service Availability, for PZPZS or ADD/ZDZ or IDD/DDM or ALRZX  : Failed   |
|------------------------------------------|
|------------------------------------------|
| 6). Verify Resiliency  : Failed   |
|------------------------------------------|
|------------------------------------------|
| 7). Verify mon component  : Passed   |
|------------------------------------------|
|------------------------------------------|
| 8). Checking the Core file  :  Failed   |
|------------------------------------------|
|------------------------------------------|
| 9). Data request checking and Usage collection checking  : Please execute /tmp/TestPerm.bash script   |
|------------------------------------------|
|========================================|
| Total e[1;32;40m Passed: 3         |
| Total e[1;31;40m Failed: 3           |
| Total No Result:    3                   |
| Total Executed: 9                      |
|========================================|

---------- Post updated 01-02-13 at 02:59 AM ---------- Previous update was 31-01-13 at 03:40 AM ----------

Hi bipinajith/All,
Can you please explain the below line of code, I will try to sort out other issues
Code:
printf "| %s ",$0; getline; s=$0; sub(/:.*/,"",s);

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to parse through a file and based on condition form another output file

I have one file say CM.txt which contains values like below.Its just a flat file 1000,A,X 1001,B,Y 1002,B,Z ... .. total around 4 million lines of entries will be in that file. Now i need to write another file CM1.txt which should have 1000,1 1001,2 1002,3 .... ... .. Here i... (6 Replies)
Discussion started by: sivasu.india
6 Replies

2. Shell Programming and Scripting

Displaying the output in the tabular Format

Hi, I have a file which contains the data in the below format and need to develop a script which will give the output in the tabular format. Could you please advice me. Folder: Workflow: version . Workflow run status: Workflow run error code: Schedule time: Workflow run type: ... (2 Replies)
Discussion started by: kandi.reddy
2 Replies

3. Shell Programming and Scripting

generate tabular output from an input text file in unix shell scripting

Hi, I have the output (as below) which i want it to be in a table. For e.g. space utilization in PSE on path /logs is 0% space utilization in PSE on path /logs/tuxedo/tuxlsp is 16% space utilization in PSE on path /ldvarlsp/lsp/log is 37% space utilization in PSE on path /home is 6%... (7 Replies)
Discussion started by: pkbond
7 Replies

4. UNIX for Dummies Questions & Answers

Put data into tabular form

Hi I am having a file which is required to be presented in the under-noted output form. Please suggest. Input: Kapil: apple 4 banana 6 cherry 0 Manoj: apple 13 banana cheery 2 Output: apple banana cherry Kapil: 4 6 0 Manoj: 13 2 Thanks in... (4 Replies)
Discussion started by: vanand420
4 Replies

5. UNIX for Dummies Questions & Answers

Put data in tabular form..

Dear Friends, I have a file as under : +++ ME 12-06-13 18:16:20 A RED FEW AND ROW1 1MN FEL AS HI FI BV LR TS HR ES MR * 0 13296 0 120 1 15 KS RR 10 0 +++ ME 12-06-13 18:26:20 A RED FEW AND ROW2 1MN FEL AS... (2 Replies)
Discussion started by: vanand420
2 Replies

6. Shell Programming and Scripting

Displaying output in the tabular format

Hi I want to display the following input data into the tabular format as shown in the output. Input.txt: Following jobs are in pending state for more than 10 minutes: JOB_ID JOB_SUBMIT_ID MAHAR 784308 PUNJA 109367 Following jobs are running for longer time: JOB_ID... (1 Reply)
Discussion started by: dats
1 Replies

7. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

8. Shell Programming and Scripting

Grep command output in tabular format

I have a grep command script which works fine and give the correct results but i wanted the output to be displayed in tabular format ? Is it possible to display the output in tabular format and as well direct them to some file. main script : #!/usr/bin/bash Start_Time=`date '+%m%d%y... (1 Reply)
Discussion started by: Optimus81
1 Replies

9. Shell Programming and Scripting

Dispaying output in tabular form

hi, I have a script which is dispaying the output as below: Column 3:value1 Column 4:value 4 column 8:value 8 column 9:value 9 column 13:value 13 Column 3:value10 Column 4:value 40 column 8:value 80 column 9:value 90 column 13:value 103 However,I need the output in tabular... (5 Replies)
Discussion started by: Vivekit82
5 Replies

10. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies
IBV_GET_CQ_EVENT(3)					  Libibverbs Programmer's Manual				       IBV_GET_CQ_EVENT(3)

NAME
ibv_get_cq_event, ibv_ack_cq_events - get and acknowledge completion queue (CQ) events SYNOPSIS
#include <infiniband/verbs.h> int ibv_get_cq_event(struct ibv_comp_channel *channel, struct ibv_cq **cq, void **cq_context); void ibv_ack_cq_events(struct ibv_cq *cq, unsigned int nevents); DESCRIPTION
ibv_get_cq_event() waits for the next completion event in the completion event channel channel. Fills the arguments cq with the CQ that got the event and cq_context with the CQ's context. ibv_ack_cq_events() acknowledges nevents events on the CQ cq. RETURN VALUE
ibv_get_cq_event() returns 0 on success, and -1 on error. ibv_ack_cq_events() returns no value. NOTES
All completion events that ibv_get_cq_event() returns must be acknowledged using ibv_ack_cq_events(). To avoid races, destroying a CQ will wait for all completion events to be acknowledged; this guarantees a one-to-one correspondence between acks and successful gets. Calling ibv_ack_cq_events() may be relatively expensive in the datapath, since it must take a mutex. Therefore it may be better to amor- tize this cost by keeping a count of the number of events needing acknowledgement and acking several completion events in one call to ibv_ack_cq_events(). EXAMPLES
The following code example demonstrates one possible way to work with completion events. It performs the following steps: Stage I: Preparation 1. Creates a CQ 2. Requests for notification upon a new (first) completion event Stage II: Completion Handling Routine 3. Wait for the completion event and ack it 4. Request for notification upon the next completion event 5. Empty the CQ Note that an extra event may be triggered without having a corresponding completion entry in the CQ. This occurs if a completion entry is added to the CQ between Step 4 and Step 5, and the CQ is then emptied (polled) in Step 5. cq = ibv_create_cq(ctx, 1, ev_ctx, channel, 0); if (!cq) { fprintf(stderr, "Failed to create CQ "); return 1; } /* Request notification before any completion can be created */ if (ibv_req_notify_cq(cq, 0)) { fprintf(stderr, "Couldn't request CQ notification "); return 1; } . . . /* Wait for the completion event */ if (ibv_get_cq_event(channel, &ev_cq, &ev_ctx)) { fprintf(stderr, "Failed to get cq_event "); return 1; } /* Ack the event */ ibv_ack_cq_events(ev_cq, 1); /* Request notification upon the next completion event */ if (ibv_req_notify_cq(ev_cq, 0)) { fprintf(stderr, "Couldn't request CQ notification "); return 1; } /* Empty the CQ: poll all of the completions from the CQ (if any exist) */ do { ne = ibv_poll_cq(cq, 1, &wc); if (ne < 0) { fprintf(stderr, "Failed to poll completions from the CQ "); return 1; } /* there may be an extra event with no completion in the CQ */ if (ne == 0) continue; if (wc.status != IBV_WC_SUCCESS) { fprintf(stderr, "Completion with status 0x%x was found ", wc.status); return 1; } } while (ne); The following code example demonstrates one possible way to work with completion events in non-blocking mode. It performs the following steps: 1. Set the completion event channel to be non-blocked 2. Poll the channel until there it has a completion event 3. Get the completion event and ack it /* change the blocking mode of the completion channel */ flags = fcntl(channel->fd, F_GETFL); rc = fcntl(channel->fd, F_SETFL, flags | O_NONBLOCK); if (rc < 0) { fprintf(stderr, "Failed to change file descriptor of completion event channel "); return 1; } /* * poll the channel until it has an event and sleep ms_timeout * milliseconds between any iteration */ my_pollfd.fd = channel->fd; my_pollfd.events = POLLIN; my_pollfd.revents = 0; do { rc = poll(&my_pollfd, 1, ms_timeout); } while (rc == 0); if (rc < 0) { fprintf(stderr, "poll failed "); return 1; } ev_cq = cq; /* Wait for the completion event */ if (ibv_get_cq_event(channel, &ev_cq, &ev_ctx)) { fprintf(stderr, "Failed to get cq_event "); return 1; } /* Ack the event */ ibv_ack_cq_events(ev_cq, 1); SEE ALSO
ibv_create_comp_channel(3), ibv_create_cq(3), ibv_req_notify_cq(3), ibv_poll_cq(3) AUTHORS
Dotan Barak <dotanba@gmail.com> libibverbs 2006-10-31 IBV_GET_CQ_EVENT(3)
All times are GMT -4. The time now is 01:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy