read $TYPE
case $TYPE in
1) MODE=binary;;
2) MODE=ascii;;
*) MODE=binary;;
esac
echo -n " Enter the name of the file to retrieve :"
read FILENAME
if [ "$FILENAME" — "" ]; then
echo "No filename entered" >&2
exit 1
fi
# по умолчанию, это tmp
echo -n -e "\f Enter the directory where the file ls to be placed[/tmp] :"
read DIREC
cd $DIREC >/dev/null 2>&1
# если нельзя перейти в нужный каталог, используйте tmp
if [ "$DIREC"="" ]; then
DIREC=/tmp
fi
if [ $? ! — 0 ] then
echo "$D1REC does not exist placing the file in /tmp anyway"
DIREC=/tmp
fi
echo -e "\t\tHost to connect is: $DEST_HQST"
echo -e "\t\tFile to get is: $FILENAME"
echo -e "\t\tMode to use is: $MODE"
echo -e "\t\tFile to be put in: $DIREC/$FILENAME.ftp"
echo -e -n "\t\tReady to get file 'y' or 'q' to quit? [y..q] :"
read ANS