i have a script that will retrive some info from database. The script is working fine but i have to add new feature in it when the script fails or retrive null result it should reflect in the log file.
below the script AMR_Inactive.sh
Code:
while read i
do
connect1=`sqlplus -silent amit/qwerty@edna.world <<END
set pagesize 0 feedback off verify off heading off echo off
SELECT meter.X_UDC_ASSET_ID
FROM
SIEBEL.S_ASSET Meter,
SIEBEL.S_ASSET SDP,
SIEBEL.s_asset_rel ARSM,
SIEBEL.S_ADDR_PER Premise,
SIEBEL.S_ASSET Route,
SIEBEL.s_asset_rel ARSR
WHERE
ARSM.par_asset_id = SDP.row_id AND
ARSM.asset_id = Meter.row_id AND
ARSM.relation_type_cd = 'SDP-METER' AND
ARSM.x_rel_status = 'Active' AND
SDP.PER_ADDR_ID = Premise.row_id AND
ARSR.par_asset_id = Route.row_id AND
ARSR.asset_id = SDP.row_id AND
ARSR.relation_type_cd = 'ROUTE-SDP' AND
ARSR.x_rel_status = 'Active' AND
Premise.X_CLIENT_PRMSE_ID = '$i';
exit;
END`
echo "Completed for $i"
echo "$connect1"
done < TNS_AMRI_INACTIVE.txt
contents of TNS_AMRI_INACTIVE.txt
Quote:
0002034694
if suppose for this data the script returns null result i should get the info "No rows returned" in my log file.i m runnig the script using crontab
AMR_Inactive.sh > AMR_Inactive.log 2>&1
Last edited by ali560045; 01-06-2009 at 02:26 AM..
Hi,
I am trying to install a package on solaris and one of the packaging scripts fail unexpectedly. There is a script called "checkinstall" which checks for the /opt space and aborts the installation if /opt is less than 100MB. In my case, even if /opt has enoguh space, the script fails.
... (8 Replies)
Hi,
I am trying to run a shell script on solaris,some time it works fine and some times it fails unexpectedly. There is a script called "autostart.sh" which automatically starts the Application server but some times the script fails to strat the application server. can anyone tell me what... (10 Replies)
Hi All,
New to unix. Here is the problem. Running a script that extracts data from hyperion essbase and generates a file in unix. This script fails most of the times with a very low success rate. The data has increased a lot in the last few months resulting in the file being more than 2 gb.
... (2 Replies)
All,
I executing a perl script and shell script from a master shell script. i will execute the perl script first and have to execute the shell script after the completion of perl execution. Below is the code i use for it,
script_root='/dev/scripts'
/usr/bin/perl -S $script_root/test.pl;... (5 Replies)
I have written a Unix Script to automate the process of File transfer from Our server to vendor Server but the automation Script fail when Progress meter is around 65-70% Complete. Why is this haapening?
See the Log File Contenet:
spawn sftp -o IdentityFile=/home/lawsched/ah_rsa XXX@YYY.com... (10 Replies)
I want to check if any file with testing*.txt exists but my script fails if more than 1 file exists. It works fine for a single file
if
then
echo "TEST21"
fi
--------------
bash:
How do I fix this?
Thanks
Please use code tags next time for your code and data. (8 Replies)
Hi,
I have the following 3 test files to test setuid bit which if it works I would like to implement in our application. However setuid doesnot seem to be having any impact on my test below.Following are the 3 files of interest in /tmp/ folder.
$ ls -ltr *env*
-rw------- 1 g332008 users 6... (23 Replies)
The following bash script fails with error message: "./phpquery_KNBB_html_reader.sh: line 65: syntax error near unexpected token `done'" when do ./<scriptname> in the shell. However when I copy-paste the entire contents of the file directly into a shell environment it runs ok returning the intended... (2 Replies)
Dear members, The following expect script connects to remote node and check for the file "authorized_keys" in directory /root/.ssh in remote node. However the result is always found even if the file exist or doesn't exist.
expect {
"$fname" {
send_user "found\n"
}
Any idea what is... (4 Replies)
Discussion started by: Sudhakar333
4 Replies
LEARN ABOUT CENTOS
source
source(n) Tcl Built-In Commands source(n)
__________________________________________________________________________________________________________________________________________________NAME
source - Evaluate a file or resource as a Tcl script
SYNOPSIS
source fileName
source -encoding encodingName fileName |
_________________________________________________________________DESCRIPTION
This command takes the contents of the specified file or resource and passes it to the Tcl interpreter as a text script. The return value
from source is the return value of the last command executed in the script. If an error occurs in evaluating the contents of the script
then the source command will return that error. If a return command is invoked from within the script then the remainder of the file will
be skipped and the source command will return normally with the result from the return command.
The end-of-file character for files is "32" (^Z) for all platforms. The source command will read files up to this character. This
restriction does not exist for the read or gets commands, allowing for files containing code and data segments (scripted documents). If
you require a "^Z" in code for string comparison, you can use "