Enviado em 17/03/2010 - 10:03h
Estou com problemas para rodar o seguinte script:
#!/bin/bash
#
DIRETORIO=/home/becape/xml
# Dados do servidor FTP
HOST_FTP="ftp.xxx.com.br"
USUARIO_FTP="xxx"
SENHA_FTP="xxx"
DIR_FTP="/teste"
function enviaftp {
ftp -in <
open $HOST_FTP
user $USUARIO_FTP $SENHA_FTP
bin
lcd $DIRETORIO
cd $DIR_FTP
put $1
bye
EOF
}
cd $DIRETORIO
ARQUIVOS=`ls | grep .xmx`
for nome in $ARQUIVOS
do
#enviaftp $nome
echo "Arquivo enviado: $nome"
done
Retorna sempre:
./test.sh: line 11: syntax error near unexpected token `newline'
./test.sh: line 11: `ftp -in <'
Desde já agradeço a atenção.
#!/bin/bash
#
DIRETORIO=/home/becape/xml
# Dados do servidor FTP
HOST_FTP="ftp.xxx.com.br"
USUARIO_FTP="xxx"
SENHA_FTP="xxx"
DIR_FTP="/teste"
function enviaftp {
ftp -in <
open $HOST_FTP
user $USUARIO_FTP $SENHA_FTP
bin
lcd $DIRETORIO
cd $DIR_FTP
put $1
bye
EOF
}
cd $DIRETORIO
ARQUIVOS=`ls | grep .xmx`
for nome in $ARQUIVOS
do
#enviaftp $nome
echo "Arquivo enviado: $nome"
done
Retorna sempre:
./test.sh: line 11: syntax error near unexpected token `newline'
./test.sh: line 11: `ftp -in <'
Desde já agradeço a atenção.