Sponsored Content
Top Forums UNIX for Advanced & Expert Users If condition and htm not working Post 302410852 by madfox on Wednesday 7th of April 2010 04:01:45 AM
Old 04-07-2010
If condition and htm not working

Code:
checkSync()
{
        CONNECT_STRING=TLDB61/TLDB61@TL10G
        SQLPLUS_SETTINGS="SET PAGESIZE 0 LINESIZE 1500 ECHO OFF TRIMS ON TAB OFF FEEDBACK OFF HEADING OFF"
        SQL_RESULT_SYNC_PMCM=`sqlplus -s ${CONNECT_STRING} << EOF
        ${SQLPLUS_SETTINGS}
        (SELECT CYCLE_CODE,CYCLE_MONTH,CYCLE_START_DATE, CYCLE_CLOSE_DATE FROM PM1_CYCLE_STATE MINUS SELECT CYCLE_CODE,CYCLE_I
NSTANCE,CYCLE_START_DATE, CYCLE_END_DATE FROM CM1_CYCLE_INSTANCE) UNION (SELECT  CYCLE_CODE,CYCLE_INSTANCE,CYCLE_START_DATE, C
YCLE_END_DATE FROM CM1_CYCLE_INSTANCE MINUS SELECT CYCLE_CODE,CYCLE_MONTH,CYCLE_START_DATE, CYCLE_CLOSE_DATE FROM PM1_CYCLE_ST
ATE);
        exit;
        EOF`

         if [$SQL_RESULT_SYNC_PMCM != 0]        then
                 echo "$SQL_RESULT_SYNC_PMCM" | mailx -s "FAILURE - Check the pm1_cycle_state and cm1_cycle_instance not in sy
nc" abc.ef@xyz.com


        fi

        echo "$SQL_RESULT_SYNC_PMCM" | awk ' \
BEGIN{
print ""
print "<html><body><table cellpadding=2 cellspacing=0 style=\047border-style: ridge; font-family: Verdana, Arial, Helvetica, s
ans-serif; font-size: 12px; font-weight:bold\047>"
print "<tr style=\047color: white; background-color:6DA2D7\047><td>CYCLE_CODE</td><td>CYCLE_MONTH</td><td>CYCLE_START_DATE</td
><td>CYCLE_CLOSE_DATE</td></tr>"
}
{print "<tr bgcolor=CCCCCC><td>" $1 "</td><td>" $2 "</td><td>" $3 "</td><td>" $4 "</td> "</td></tr>" }
END {
print "</table></body></html>"
}' > ALERT.htm

}


In the above code I am trying to collect a result from a query to (SQL_RESULT_SYNC_PMCM)

Then checking if the content is not zero (how to check it ) my condition is not working.

Also trying to collect it in a htm which is also not working

Please help correct the code.

Last edited by pludi; 04-07-2010 at 05:10 AM.. Reason: code tags, please...
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If condition not working

Hi Gurus, I have shell script in which i have to check if time is between to possible value or not. For that i am using following line of code if then echo 'Found In Between' echo $ftime ... (5 Replies)
Discussion started by: MANISH KU
5 Replies

2. Shell Programming and Scripting

wild card in if condition not working

Hi, I am using RHEL5. I have following if condition. if In the above condition, if the value of a contains word WARNING, it should match. i.e., WARNING_MESSAGE, CRITICAL WARNING, WARNING ALERT etc. it should match. For b, alert error, ALERT ERROR, ERROR IMMEDIATE ACTION REQUIRED, etc... (2 Replies)
Discussion started by: user7509
2 Replies

3. Shell Programming and Scripting

Using ssh to transfer file not working inside if-condition

Hi all, ssh uname@remote_server 'cat /tmp/remote_file_name > home_dir/a512386/new/local_file_name' The above given command is working fine. but if i try to move the file only if exists in the remote server i.e) giving the same within if condition it executes but the file is not stored in my... (1 Reply)
Discussion started by: Shri123
1 Replies

4. Shell Programming and Scripting

finding php, html, htm files

how can i limit the output to only php, html, htm files? i found this as one way find . -regex ".*\(php\|html\|htm\)$" -type f -print0 | xargs -0 grep 'keyword'and it works but is a bit slow is there any faster way? i tried something like this but it doesnt work: find ./ -iname "*.php"... (2 Replies)
Discussion started by: vanessafan99
2 Replies

5. Shell Programming and Scripting

Search replace hostname in htm files

Need assistance in changing the hostname I have multiple html files in a directory , its src is pointing to houston.sp.com and it needs to change to alaska.sp.com . Below is the example Trying to use perl to change it . Need suggestiong <img border="0"... (3 Replies)
Discussion started by: ajayram_arya
3 Replies

6. UNIX for Beginners Questions & Answers

If condition is not working and getting error

Hi Team, If condition is not working properly and getting below error # ./score1.sh Enter your score ('q' for quit): 102 Enter your score ('q' for quit): q ./score1.sh: line 9: q: integer expression expected Average is: 102%. Exit. Actual code # Calculate the average of given... (3 Replies)
Discussion started by: Torrid
3 Replies

7. Shell Programming and Scripting

If condition on shell not working , not sure what is the mistake I am doing?

I have a requirement to perform specific set of tasks based on server , So I want to have the condition(s) defined based on server. Here is the script I came up with and I have read multiple blogs and couldn`t find any mistake from my script. Can you guide on what I am overlooking here ? ... (2 Replies)
Discussion started by: Varja
2 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 10:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy