I have had a quick try at simplifying this script for you.
I managed to identify 3 different tests you are doing and created a check() function that
will cover these cases. It checks for a match and returns zero of no match. Otherwise it logs when required and returns 1. The return value is added to each of your counters.
I'm sure there could be much more simplification if you specified you expressions and counter names in another config file. But you would still need to edit the config file to change the tests so I doubt much more would be gained going that way.
Below, I use check() function to increment counters for your 3 different test cases - your job is to extend this for the full testing set. Note there is no need to initialise the counters as they will be set to zero automatically once the first line is processed.
Last edited by Chubler_XL; 08-23-2016 at 03:48 PM..
Reason: Better variable names - remove initialise of vars
I would like to know how I could do the following :
void func(){
int a = 100; b=0;
int c = a/b;
}
void sig_handler (int sig,siginfo_t *info,void *context){
//signal handling function
//here I want to access the variables of func()
}
int main(){
struct sigaction *act =... (7 Replies)
Hi,
I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows:
""""""""""""""""""""""""""... (3 Replies)
:confused:Hi ,
Can someone please advise what is the meaning of metacharacters in below code?
a_PROCESS=${0##*/}
a_DPFX=${a_PROCESS%.*}
a_LPFX="a_DPFX : $$ : "
a_UPFX="Usage: $a_PROCESS"
Regards,
gehlnar (3 Replies)
what does this line in a script mean??
I have tried to give it at the command prompt and here is what it returns
ksh: /db2home/db2dap1/sqllib/db2profile: not found.
. /db2home/db2dap1/sqllib/db2profile
i have tried the same thing for my home directory too and the result is the same
.... (5 Replies)
Hey Guys,
Does anyone know how to count the separate amount of words in a text file?
e.g
the 5
and 20
Furthermore does anyone know how to convert whole numbers in decimals?
Thanks (24 Replies)
Dear All,
I am an performance tester. Now i am working in project where we are using linux 2.6.32. Now I got an oppurtunity to learn the monitoring the server. As part of this task i need to do analysis of the Nmon report. I was completely blank in this.
So please suggest me how to start... (0 Replies)
Appreciate help for the below issue.
Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt..............
1)if logs exist it should move the logs with extention... (1 Reply)