Sponsored Content
Top Forums Shell Programming and Scripting Script Not working as per its build Post 302521516 by baraghun on Wednesday 11th of May 2011 12:39:27 PM
Old 05-11-2011
Before script does execute the main function , it undergoes several stages to get the User Understandable Text output instead of typical XML format. This script was built to Isolate Error Transaction from bulky XMLlog and refine the Error's by its types.

Firstly the script does some searching of current and archived file provided by the user in Service Log Directory.Once the the search finds the file in the directory concurrently User wants Errors to be isolated from the found archived or current dated file. User provides the switch (-a) along with two arguments passed, one is date (yyyy-mm-dd) format and other argument is file (ap_managementServices). But archived files will be in a format of ap_managementServices_Group[1-5]-2011-04-03.log.gz. When user wants to isolate the errors from current day log, he/she will be passing just (-l) switch along with current day file ap_managementServices_Group[1-5] and all the errors logs irrespective of error type will be isolated and stored under ErrorLog Dir.

Note: [1-5] .. Is a range of log file.



Secondly the script does pure refining the error logs based on its type.There are different type of Errors based on Application design. For example, we have Client.404 , Client.700 , Client.705 for client based errors, similarly for Server bound Error we have Server.500, Server.501, Server.502.
Each error code has its own specification .So we have placed these Client & Server codes (In ClientErr & ServerErr) as search string for the script when user opts any one of the options (-c) & (-s). Below is the result in a un-formatted way.

Code:
Client.404  91   The authorization or verification request was declined. : nvalid CC Number 
Server.500   6   The authorization or verification request was declined. : Unidentifiable Error
Server.502   2   The authorization or verification request was declined. : Unable to determine | The error because of invalid response code!
Client.705   7   The authorization or verification request was declined. : Processor Decline
Server.501  12   The authorization or verification request was declined. : No Account
Client.400  11   The authorization or verification request was declined. : Lost/Stolen

Thirdly the script gets the results from above procedure and store it in other file, to display it in a Proper table format. Below is the result.

Code:
------------------------------------------------------------------------------------------------
Error Code |Count| Error Description
------------------------------------------------------------------------------------------------
Client.404 | 91  | The authorization or verification request was declined. : nvalid CC Number 
Server.500 |  6  | The authorization or verification request was declined. : Unidentifiable Error
Server.502 |  2  | The authorization or verification request was declined. : Unable to determine 
Client.705 |  7  | The authorization or verification request was declined. : Processor Decline
Server.501 | 12  | The authorization or verification request was declined. : No Account
Client.400 | 11  | The authorization or verification request was declined. : Lost/Stolen
-------------------------------------------------------------------------------------------------

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want to build a script

I have file which has "A" character in more than 1000 lines and I want replace this "A" with "f". There is also "A" which I don't want to replace at the last line. Currently, I use this script to replace them one by one :g/A/s//f/g Regards (2 Replies)
Discussion started by: mewalter
2 Replies

2. Shell Programming and Scripting

Script Build

I have a 3 status option 1 , 4 , 6 1 - Active 4 - Temp.. 6 - Deactive I want to build a script which when it finds either of the status options (1,4,6), then returns the relevant string. txs :confused: (3 Replies)
Discussion started by: mewalter
3 Replies

3. Shell Programming and Scripting

I want to build a script

I have this script sed -e '$q' -e 's/I/D/g' <inputfile> outfile which replaces I by D... I have to run this script in 90 files which their filename starts with CD*. I want to call all these files and execute this command once. Or schedule it to be executed at 1600hrs every day. I want... (7 Replies)
Discussion started by: mewalter
7 Replies

4. Shell Programming and Scripting

Build script for all shells

Hi, I made a build script for the product I am working on. The script was made in the /bin/sh shell. My first line in the script (after the #! /bin/sh and following # lines ) were, if ; then /bin/sh fi; It works well with my sh shell. I run the script as sh build.sh Now I... (9 Replies)
Discussion started by: vino
9 Replies

5. Shell Programming and Scripting

How to build a command in a script

Hi All I am trying to build a script that will take data from a tab separated file and use that to split up a quicktime file. So far the code is as follows #!/bin/sh #test parsing of data #fix excel file output returns cat $1 | tr "\r" "\n" > $1.fix printf "\n" >> $1.fix mv $1.fix $1 ... (3 Replies)
Discussion started by: babajuma
3 Replies

6. UNIX for Dummies Questions & Answers

sudo apt-get install build-essential not working

it asks for password and then following is displayed Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package build-essential what should i do to install g++ compiler? (4 Replies)
Discussion started by: sparkle
4 Replies

7. Shell Programming and Scripting

Script is not working from cron while working manually

Hello, I am facing a very strange problem when I run my script manuallu ./Fetchcode which is using to connect with MKS integrity from linux end it workks fine but when I run it from cron it doesn't work.Can someone help me 1) How could I check my script when it is running from cron like... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

8. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

9. UNIX for Dummies Questions & Answers

Adding SDK Build on Kernel Source Build

Hi, So I downloaded this kernel source and was able to build it successfully. But I want to add this SDK source code inside, can anyone help me how to do this? Note that the SDK source can be built by itself. I added the SDK in the main Makefile: init-y := init/ #added SDK... (0 Replies)
Discussion started by: h0ujun
0 Replies

10. Shell Programming and Scripting

Build.xml invocation by Build Script

Hi I have a build.xml file and I can run it on Windows via cmd. Now I want to write a script to invoke the same. Is there a way to do this? (1 Reply)
Discussion started by: ankur328
1 Replies
Test::Script(3) 					User Contributed Perl Documentation					   Test::Script(3)

NAME
Test::Script - Basic cross-platform tests for scripts DESCRIPTION
The intent of this module is to provide a series of basic tests for 80% of the testing you will need to do for scripts in the script (or bin as is also commonly used) paths of your Perl distribution. Further, it aims to provide this functionality with perfect platform-compatibility, and in a way that is as unobtrusive as possible. That is, if the program works on a platform, then Test::Script should always work on that platform as well. Anything less than 100% is considered unacceptable. In doing so, it is hoped that Test::Script can become a module that you can safely make a dependency of all your modules, without risking that your module won't on some platform because of the dependency. Where a clash exists between wanting more functionality and maintaining platform safety, this module will err on the side of platform safety. FUNCTIONS
script_compiles script_compiles( 'script/foo.pl', 'Main script compiles' ); The "script_compiles" test calls the script with "perl -c script.pl", and checks that it returns without error. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. Note also that the test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. script_runs script_runs( 'script/foo.pl', 'Main script runs' ); The "script_runs" test executes the script with "perl script.pl" and checks that it returns success. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. The test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. SUPPORT
All bugs should be filed via the bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Script <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Script> For other issues, or commercial enhancement and support, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
prove, <http://ali.as/> COPYRIGHT
Copyright 2006 - 2009 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.2 2009-11-23 Test::Script(3)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy