Script Not working as per its build


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script Not working as per its build
# 1  
Old 05-11-2011
Script Not working as per its build

Can someone take a look into script, where and what is going wrong in this.
# 2  
Old 05-11-2011
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.
# 3  
Old 05-11-2011
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.

Code:
$ ./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


Last edited by baraghun; 05-11-2011 at 07:17 AM..
# 4  
Old 05-11-2011
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.
# 5  
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
-------------------------------------------------------------------------------------------------

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
Login or Register to Ask a Question