Jump to content

need help with ftp shell script


crp

Recommended Posts

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 by crp
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...