Hi,
i want to search a file existed in another or not using ftp command as follows. When i was using the script there was a problem like data connection is not opened. Please suggest any one..below is text.sh
FTPUSER="user1"
FTPPW="
pwd1"
DIR="/home/pbommire/"
CD="cd ${DIR}"
TEMPFILE1="green.txt"
TEMPFILE2="green.txt"
ftp -inv 635.23.33.23> $TEMPFILE1 2> $TEMPFILE1 << EOF
user $FTPUSER $FTPPW
binary
prompt
${CD}
ls -ltr Praveen/test.txt
close
bye
end
echo "Connection success...."
i=`grep -i "test.txt" Praveen/test.txt`
if test "i = "" ;
then
echo "file not found"
fi
===============================
The output file green.txt as follows
===============================
Connected to 635.23.33.23.
220-Hello, Welcome toKERBEROS_V4 rejected as an authentication type
ady.
504 AUTH GSSAPI not supported.
504 AUTH KERBEROS_V4 not supported.
331 Password required for pbommire.
230 User pbommire logged in.
200 Type set to I.
Interactive mode on.
250 CWD command successful.
output to local-file: Praveen/test.txt? 227 Entering Passive Mode (635.23.33.23)
425 Can't open data connection.
221 Goodbye.