IF Statements within an FTP Session

This is a discussion about IF Statements within an FTP Session in the Everything Linux category; 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 1800 This topic was started by , . Last reply 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 in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.
Jan 12
Created
Jan 16
Last Response
0
Likes
<1 minute
Read Time
User
Users

Responses to this topic