IF Statements within an FTP Session

Good Afternoon Ladies & Gents. Is it possible to write a script that opens up a ftp session and then use ' if and for loops '. ie. ftp -n -i xxx. xxx. xxx. xxx <<EOF user username password binary if then echo FILE FOUND else echo FILE NOT FOUND ; fi ???????? Any input would be greatly appreciated.

Everything Linux 1798 This topic was started by ,


data/avatar/default/avatar06.webp

8 Posts
Location -
Joined 2003-11-20
Good Afternoon Ladies & Gents.
 
Is it possible to write a script that opens up a ftp session and then use ' if and for loops ' .
ie.
 
ftp -n -i xxx.xxx.xxx.xxx <<EOF
user username password
binary
 
if [ -f /home/bob/logs.doc ]
then echo FILE FOUND
else echo FILE NOT FOUND ;
fi
 
????????
 
Any input would be greatly appreciated.
 
Regard

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic