FTP in shell script

HI ALL

i am writing a shell script in which i have to use FTP command like.
FTP <ip address>
cd xyz
mget*
bye

but i am not able to perform any command from shell script.
once the control goes to FTP, i again have to type all the things.
i just want my shell script to take care of the commands wrritten above.

please help me to automate the process

If you search the web for example via Google and use the words "ftp shell script" you get tons of hits with examples. You can also look for "Here Scripts".

thanks for your reply.
actually ia m looking for how to use mget * command.
for every file to get it requires a key press.
i am not sure how to do this.
plz help.

There is the ftp command "prompt" which will make it non-interactive or there will be also a switch for ftp like -i.

that was brilliant!!

thanks a lot

Depending on what you're doing using the wget command might be easier.

an expect script would do the job nicely too.. don't you pass the login and password in the ftp script?

You may want to refer to this dude :slight_smile:

Don't forget to check out "ncftp" to replace "ftp" - it's extremely more cool.