2>&1 -- This is going to redirect stderr to stdout
result=`ftp -nv 111.111.111.111 << EOF 2>&1user $USER $PASSWD
put file.txt
bye
EOF`
ctr=`echo "$result" | grep "226 Transfer complete" | wc -l`
#for error check, check the return string as it's different for FTP and SFTP
err_ctr=`echo "$result" | grep "Couldn't read packet" | wc -l`
if [ $ctr -gt 0 ]
then
echo "File Transfer successful"
elif [ $err_ctr -gt 0 ]
then
echo "connection failure"
fi
joya shoes 195g7ekhal812 joya sko,joya sko,joya skor,Cipő joya,zapatos joya,joya schoenen verkooppunten,Scarpe joya,chaussures joya,joya schuhe wien,joya schuhe joya shoes 200e8gdzdc321
ReplyDelete