ftp -v -n $Host << FTPSCRIPT
user $Username $Password
the above is a simplified snippet from a shell script that I'm working on at the moment. It basically logs into an FTP account, changes directory, then deletes a file and exits. This works OK.
The problem I'm having is that it never gets to the echo "completed..." line and doesn't continue with the rest of the script.
Anyone have any ideas why that is? I've got a feeling this is something very simple that I'm missing to do with the redirection but haven't been able to find an explanation online. I'm pretty new to shell scripting.
Never mind. Figured it out eventually. As my code is indented to keep it nice and tidy (which you don't see in the snippet above), the FTPSCRIPT line was indented with a tab, where it needs to be at the start of a new line for it to be recognised as the closing string. Doh!