Script Not working as per its build

Can someone take a look into script, where and what is going wrong in this.

What error do you get? At what line? Did you try running your script with set -x set?

The description you've given and the attached script are completely useless for your request, as that would require us to have exactly the same environment as you do to reproduce the error.

Not getting any result for which it has been build, I know there are errors in the script, but needs to identify. Below are the error-less result with null output.

$ ./providertext.sh -a 2011-04-03 subscibermanage

$ echo $?
0

$ ./providertext.sh -a 2011-04-03 subscibermanage -c
Syntax: providertext.sh [ -l <LOG_FILE> | -a <DATE:YYYY-MM-DD> <OLD_LOG_FILE> ] <-c | -s>

$ echo $?
1

$ ./providertext.sh -l dp_subscibermanagement -s
$ echo $?
0

$ ./providertext.sh -l dp_subscibermanagement -c
./providertext.sh: option requires an argument -- c
Syntax: providertext.sh [ -l <LOG_FILE> | -a <DATE:YYYY-MM-DD> <OLD_LOG_FILE> ] <-c | -s>

$ echo $?
1

$ ./providertext.sh -a 2011-04-03 subscibermanage -s
Syntax: providertext.sh [ -l <LOG_FILE> | -a <DATE:YYYY-MM-DD> <OLD_LOG_FILE> ] <-c | -s>

$ echo $?
1

We ain't psychic (although it would be nifty). What's the expected output? What do the command line switches mean? What's the format of the log file you're referencing?

Don't forget: we don't know where you work, what you do, what your environment is like, what this script should accomplish, what mood you're in today. You'll have to provide all information required to understand the problem or otherwise we won't really be able to help you beyond a few stabs in the dark that may or may not help.

This might be helpful too.

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.


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.


------------------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------------------