FTP inv tee Query

Hi,

This is part of a ftp script, Can someone please explain what is its functionality or the basic idea behind it and please throw some light on the inv & tee function marked in red.

echo "bye" ) | ftp -inv | tee -a ${DOWNLOAD_LOG} | awk '{ print $0 } /^5[0-9[0-9]./ { print "\n\t\t\tFTP session had some errors" }' | awk '/^2[0-9][0-9][- ]You./ { print "\n\t\t\t"substr($0,5) }'

Thanks
Sparks

i think there are few more echo statements before echo "bye"
all that are piped to ftp command in ftp -i -n -v are option gothrough the man page of ftp. and the o/p of ftp is appended to the logfile tee -a will append to the exsisting file then log file is checked for any error in ftp..