Hi,
This 'solution' will grab all the output the ftp session creates, not only the line specified (put file). So this could not be what you are looking for.......
Code:
#!/bin/sh
HOST='80.172.10.255'
USER='ahahahah'
PASSWD='eheheheh'
OUT="$(ftp -n $HOST 2>&1 <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put file
quit
END_SCRIPT
)"
echo "Output is: $OUT"
exit 0
Hope this helps.