Automating FTP Session through Shell Script

Many times we save lot of time if we automate things.

Assume you want to put a fine named abcd.doc in server named www.myserver.com.
We will do as follows in terminal/command prompt

ftp www.myserver.com

Then it will ask for USERNAME and PASSWORD, if we enters correctly FTP session for us opened successfully. Then we can use ftp commands to put/get files to/from www.myserver.com. For putting abcd.doc we will use command put as follows

ftp>put abcd.doc

Then we will use bye to exit ftp session

ftp>bye



Automating above session through shell script
Assume user name is usermane and password password for logging into system www.myserver.com



user username password
put abcd.doc
close
bue
SCRIPT
exit 0



You can use IP address also instead of server name.


Comments

Popular posts from this blog

LAPD vs LAPDm

LAPD vs LAPDm(Technical)

Shell Script for Extracting all the lines containing a particular string