- Joined
- Oct 5, 2010
- Messages
- 6
- Reaction score
- 0
- Points
- 1
I am new to Shell scripting. I found an example script to do an FTP file transfer and modified it to my circumstances. It seems straightforward:
#!/bin/bash
ftp -i ftp://username:[email protected]
cd big/long/pathname/
get filename.zip /localpath/filename.zip
bye
EOF
Invoked from Terminal it connects successfully but the cd command does not execute and I simply get the ftp> prompt within terminal like this:
Connected to theserver.com.
220 theserver.com FTP server ready.
331 Password required for username.
230 User username logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Type set to I.
ftp>
I can now execute ftp commands. If I type exit, the last two lines of the script (cd and get lines) then execute out-of-context within terminal and generate "command not found" errors.
Any suggestions on why the cd and get commands won't execute from inside the script after ftp connects?
Thanks in advance. ~Ed
#!/bin/bash
ftp -i ftp://username:[email protected]
cd big/long/pathname/
get filename.zip /localpath/filename.zip
bye
EOF
Invoked from Terminal it connects successfully but the cd command does not execute and I simply get the ftp> prompt within terminal like this:
Connected to theserver.com.
220 theserver.com FTP server ready.
331 Password required for username.
230 User username logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Type set to I.
ftp>
I can now execute ftp commands. If I type exit, the last two lines of the script (cd and get lines) then execute out-of-context within terminal and generate "command not found" errors.
Any suggestions on why the cd and get commands won't execute from inside the script after ftp connects?
Thanks in advance. ~Ed