Sponsored Content
Full Discussion: Please correct my script
Homework and Emergencies Emergency UNIX and Linux Support Please correct my script Post 302547950 by raghunsi on Wednesday 17th of August 2011 05:32:00 AM
Old 08-17-2011
Please correct my script

Please correct my script if it any exceptional, since im calling other external script with in my script.

Code:
#!/bin/bash

FE1=TMM
DT1=/home/myHome/dated_1
REPORT=/home/otherHome/Report.sh

## Run the report for FE1 & DT1

cd /home/myHome
SERV_LST=/home/myHome/srvc-lst
echo "Welcome to other home"
echo "Running The Report for You NOW"
for i in `cat $SERV_LST`
do
$REPORT  $i -f {FE1} -d {DT1}
done
if [ $? -ne 0 ]
then
 echo " There is Some Issue"
fi
exit 1

Content of DT1

Code:
20110603
20110606
20110612
20110711
20110724
20110811

Content of SERV_LST
Code:
-a myServiceService -o myServiceBillCycleList
-a myServiceService -o myServiceCTypeInfo
-a myServiceService -o myServiceDTypeInfo
-a myServiceService -o myServiceHpptt
-a myServiceService -o myServiceLargeBan
-a myServiceService -o myServiceMarketInfo
-a myServiceService -o myServiceParameterValues
-a myServiceService -o myServiceSecurityInfo
-a myServiceService -o myServiceStaticIp
-a myServiceService -o myServiceTin
-a myResourceInfoService -o TMSAvailableNxx
-a myResourceInfoService -o TMSEnrollResourceHistoryList
-a myResourceInfoService     -o TMSEnrollTalkGroupList
-a TMSEnrollInfoService -o TMSAslAccount
-a TMSEnrollInfoService -o TMSEnrollAttributes
-a TMSEnrollInfoService -o TMSEnrollBasicInfo
-a TMSEnrollInfoService -o TMSEnrollSer
-a TMSUsageService -o TMSEnrollBilledU
-a TMSUsageService -o TMSEnrollUnbilledU
-a TMSUsageService -o TMSEnrollUnbilledUs
-a myTMSService -o AuthenticateUserLogin
-a myTMSService -o UpdateEPassword
-a myTMSService -o UpdateMailPasscode
-a myTMSService -o validateAccountPin
-a SmsPreference -o TMSSmsPrefeInfo
-a SmsPreference -o UpdateSmsPreferenceInfo
-a StatusCenterService -o TMSStatusCenterMessages
-a EnrollManagementService -o ManageEnrollServices
-a EnrollManagementService -o SetEnrollMarketingPreference
-a EnrollManagementService -o SubmitOrder
-a EnrollManagementService -o UpdateEnrollDetails

\

This script is needed to generate hundreds of reports, which is time consuming. The result im getting is nothing but a nested script usage, that means my script is having problem with usage parameter.

Nested Script Usage parameter is something like this:

Code:
./report.sh -a TMSServ -o updateTime -f XYZ -d DATE

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Please Correct this Array Script

Here is the script. I am not able to increment and Print echo "2=" ${arr} (Bold line) Can someone please help me correct it? I am thinking there is some escape sequence error. Just started learning scripts ... Thanks #!/bin/ksh set -A arr a1 a2 a3 a4 # START Server1=gmi ... (6 Replies)
Discussion started by: psreddy1234
6 Replies

2. Shell Programming and Scripting

Is the script correct ???

Dear Collegues is the below given is correct ? #!/usr/bin/perl $a = @ARGV; while ($a = @ARGV) { exec "./jagan ../dat/ml_in @ARGV"; } Jagan (0 Replies)
Discussion started by: jaganadh
0 Replies

3. Shell Programming and Scripting

Please correct my Script

I am new to awk, can somone please correct the following script awk -F "," 'BEGIN { foreach ((getline < "file1.csv") > 0) {i++ a=1 --> assuming the first column in the row will be stored in a foreach (a in f1) { if (a == $5) continue print a; } } } file2.csv' Here is what I... (11 Replies)
Discussion started by: nuthalapati
11 Replies

4. Shell Programming and Scripting

something is not write in the script. Can some one please correct this.

Wrong post (2 Replies)
Discussion started by: tuffEnuff
2 Replies

5. Shell Programming and Scripting

Please correct the error in the following script

#!/bin/ksh db_user=$DB_USER_NAME db_pwd=$DB_PASSWORD db_sid=$TWO_TASK if ; then echo "\tUsage: MoveUsageProcessing <BC Log file Name>" exit 1 else BCLogFileName=$1 fi grep -i 'MoveUsage daemon needs to run on this account before it can be billed' $1 |awk -F\| '{for(i=0;++i<=NF;) if($i ~... (1 Reply)
Discussion started by: Rajesh Putnala
1 Replies

6. Shell Programming and Scripting

Can anyone correct the error in this script

ret=`sqlplus -s /nolog << EOF connect $db_user/$db_pwd@$db_sid; SPOOL ./$DirectoryName/TableData.txt; set pagesize 0 feedback off verify off heading off echo off linesize 150 while read var_ack_party_name do select * from bus_event where ack_party_name like... (13 Replies)
Discussion started by: rkrish
13 Replies

7. Shell Programming and Scripting

Please Correct My script

############### #filename.sh ############### CUREENT_DATE=02 log_file_path="$CUREENT_DATE"-"${0##%*/}`|cut -d "." -f1|awk -F "/" '{print $NF}'`"".log" echo $log_file_path ################ #output required 02-filename.log (6 Replies)
Discussion started by: mohitmehral
6 Replies

8. Shell Programming and Scripting

Need output of script on screen and file with correct return status of the called script.

Hi, I am trying to capture logs of the script in the file as well as on the screen. I have used exec and tee command for this. While using exec command I am getting the correct output in the file but, script output is not getting displayed on the screen as it get executed. Below is my sample... (14 Replies)
Discussion started by: Prathmesh
14 Replies

9. Shell Programming and Scripting

Can some one correct this script

Hi, I tried writing a script and there was a problem with SFTP part can some one correct where is is the mistake Enveronment file #!/bin/bash export HOST_NAME=<> export USER_NAME=<> export PASSWORD=<> export SOURCE_PATH=/u03/informatica/current/server/infa_shared/TgtFiles/mfg export... (4 Replies)
Discussion started by: spradeep86
4 Replies
Tcl_AllowExceptions(3)					      Tcl Library Procedures					    Tcl_AllowExceptions(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_AllowExceptions - allow all exceptions in next script evaluation SYNOPSIS
#include <tcl.h> Tcl_AllowExceptions(interp) ARGUMENTS
Tcl_Interp *interp (in) Interpreter in which script will be evaluated. _________________________________________________________________ DESCRIPTION
If a script is evaluated at top-level (i.e. no other scripts are pending evaluation when the script is invoked), and if the script termi- nates with a completion code other than TCL_OK, TCL_ERROR or TCL_RETURN, then Tcl normally converts this into a TCL_ERROR return with an appropriate message. The particular script evaluation procedures of Tcl that act in the manner are Tcl_EvalObjEx, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval and Tcl_VarEvalVA. However, if Tcl_AllowExceptions is invoked immediately before calling one of those a procedures, then arbitrary completion codes are per- mitted from the script, and they are returned without modification. This is useful in cases where the caller can deal with exceptions such as TCL_BREAK or TCL_CONTINUE in a meaningful way. KEYWORDS
continue, break, exception, interpreter Tcl 7.4 Tcl_AllowExceptions(3)
All times are GMT -4. The time now is 03:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy