crp Posted August 25, 2013 Share Posted August 25, 2013 (edited) the script: #!/bin/sh if [ -e "/home/mailspool/checee/sema4.file" ] then nCount=0 while [ "$nCount" -lt 9 ] do echo step $nstep sleep 1 if [ -e "/home/mailspool/checee/sema4.file" ] then sleep 1 nCount=`expr $nCount + 1` else echo 'busy with ' >> /home/mailspool/checee/sema4.file echo $extension >> /home/mailspool/checee/sema4.file nCount=30 fi done ftp -in <<END_SCRIPT open ftp.ourplace.tld user 1234 5678 bin hash prompt cd smrsh put in.$extension bye END_SCRIPT \rm /home/mailspool/checee/sema4.file When i used EOF it worked fine, but I can no longer use EOF as i want to erase the semaphore file. But now the script runs but no ftp is even attempted. What am I getting wrong? Edited August 25, 2013 by crp Quote Link to comment Share on other sites More sharing options...
alphaomega Posted August 26, 2013 Share Posted August 26, 2013 Sorry, don't know. But shouldn't there be another "fi" to close out the very first "if" statement? 1 Quote Link to comment Share on other sites More sharing options...
crp Posted August 26, 2013 Author Share Posted August 26, 2013 Thanks! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.