The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
2 or more if conditions dr_sabz UNIX for Dummies Questions & Answers 3 01-15-2009 06:20 AM
problem with if, while, for conditions kittusri9 Shell Programming and Scripting 3 04-24-2008 09:15 AM
Search Mulitiple String pattern in a file krishnan_6015@y Shell Programming and Scripting 2 11-23-2007 04:03 AM
if statement with two conditions cin2000 Shell Programming and Scripting 1 01-23-2006 03:21 PM
Mulitiple Nic's Magnus IP Networking 2 11-05-2001 10:15 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-10-2009
sud sud is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 12
Mulitiple conditions in While Do loop.

Hi guyz,

I have a WHILE loop which shud DO certain jobs when it satisfies the condition and it does…but I also need to assign a different job if it doesn’t satisfy the condition..how can I do this.Below is my script.


if [ `datecalc.ksh -a $sysdate - $vdt1` -ge 7 ];
then
echo "if statement"
while [ 7 -le `/erp/apps/infa/PowerCenter8.1.1/server/infa_shared/SrcFiles/datecalc.ksh -a $sysdate - $vdt2` ]# (This checks if the difference of dates is less than 7,it is exiting out of the loop if the date diff is > 7..I want to send an email if it is > 7 but where can I have that in a WHILE/DO loop? )
do
# vdt3 should be used in FTP Archive and rename #
vdt3=$(printf "%04d%02d%02d" $vdt2)
echo $vdt3
echo " in while loop"
# ----------------------------------------------------
# Set Environment for HEC Schema.
# ---------------------------------------------------
#Kicking off the STG workflow #
pmcmd startworkflow -sv SPRDEV23REP_Integration_Service -d Domain_ebi55rdv -u DEVUSER -p ******* -f CWT_STG -wait wf_tes
t
echo "Done pmcmd"
# Calling the rename files
#/erp/apps/infa/PowerCenter8.1.1/server/infa_shared/SrcFiles/cwt_rename_files_npc.sh $vdt3
echo $vdt3

#updating the date from the table
abc=`sqlplus -s A23300/******@ODSDEV553 <<eof
whenever sqlerror exit sql.sqlcode;
set serveroutput on;
UPDATE IBP_RES_NPC.LOAD_DATE
SET LOAD_DATE = TO_DATE('$vdt3','yyyymmdd');
COMMIT;
EXIT;
eof`

# while loop increment vdt2
vdt2=`/erp/apps/infa/PowerCenter8.1.1/server/infa_shared/SrcFiles/datecalc.ksh -a $vdt2 + 7`
echo $vdt2
done
fi

Thanks,
Sud
  #2 (permalink)  
Old 06-21-2009
figaro figaro is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 267
Do you need it in a while loop? Why not something like:
if [datedifference <= 7] enter while loop, else send email.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0