The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
If Then Else Logic jadionne UNIX for Dummies Questions & Answers 7 11-23-2007 04:27 AM
cannot get the logic dineshr85 Shell Programming and Scripting 3 10-11-2007 08:34 AM
expand logic for > and < pbsrinivas Shell Programming and Scripting 0 08-10-2007 10:59 AM
Need help in genrating the logic amitjha Shell Programming and Scripting 6 11-08-2006 06:45 AM
what the logic ramneek IP Networking 2 09-05-2005 08:42 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-30-2008
sambakamba sambakamba is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 5
While Loop Logic

I would need to with making while loop logic working in shell program when I am new into the shell programing
1) I would need to try to get the file from the remote side ----need to try 15 mins apart for 4 times and terminate the program if file is not available....

I would need to know how I can setup counters to try in while loop ......

as I have sample at below. Please assist

==============================================
for file in $FILES; do
echo
echo "About to Retrieve $file from $SOU$SRDIR"
echo "via $proxy"
echo
err=1
while [ "$err" != 0 ]; do
ssh -x $proxy ftp "$SOU$SRDIR$file"
err=$?
if [ "$err" != 0 ]; then
echo "File transfer failed. Bummer. $err"
echo "Trying again in 15 minutes"
sleep 900
fi
done
echo " Retrieving file $file ..."
scp -p $proxy:~/$file .
chmod 666 $file
ls -l $file
ssh -x $proxy rm $file
done
==========================================
 

Bookmarks

Tags
while loop logic

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 01:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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