Script ftp multiple servers

Hi guys , i have 1 problem and no find what is the problem...:confused:, and .netrc is configured and correct permissions...

REMOTE="/home/user"
LISTADO=`cat /root/home/user/LISTADO.txt`
MACHINE=$(echo $i|awk 'FS="|" {print $1}')

for i in $LISTADO
do

ftp $MACHINE <<TER
passive
prompt
cd $REMOTE
mget *.html
bye
TER

done

Thx in advance!!

Well you haven't actually said what your problem is, but at a guess, the script is totally confused!
Your line to determine MACHINE uses $i which is not set outside the for loop. Move the "MACHINE=" line into the loop.

I am also confused, however, this may (or may not) be of some use...

#!/bin/sh

REMOTE="/home/user"

LISTFILE=/root/home/user/LISTADO.txt

for i in `cat $LISTFILE | awk -F\| '{ print $1 } '`
do

ftp $i <<!
passive
prompt
cd $REMOTE
mget *.html
bye
!

done