6

Shell script terminated after ftp transfer

view full story
linux-howto

http://www.linuxforums.org – Hi, I made a shell script with the following piece of code to transfer some files via ftp: Code: echo 'before ftp'       ftp -n $FtpHost << EOF         quote USER $FtpUser         quote PASS $FtpPasswd         quote CWD $FtpDir         put $FileNameLog         put $FileNameSqlTarSum         put $FileNameSqlTar         put $FileNameWwwTarSum         put $FileNameTar         quit       EOF echo 'before rm'               rm $FileNameWwwTar $FileNameWwwTarSum $FileNameSql $FileNameSqlTar $FileNameSqlTarSum $FileNameLog echo 'after rm' The problem is that the script ends after the "quit" command in FTP, so code after it won't run, like the remove of temporary files. If I remove this "quit" command, the shell understands I'm still parsing commands to FTP, although being after the EOF. I used this echo commands to check which parts of the script are running. Do somebody have a clue of why is this happening? Thank you, Josep Maria (HowTos)