[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] - Semplice script bash



Salve a tutti,
scusate l'OT ma sto avendo difficoltà a realizzare lo script trasferimento.sh:

---------------------------------------------------------------------
#!/bin/bash

WORKINGDIR="/tmp/"
STORICO="/data/medici"
HOST='xxx.yyy.zzz.ttt'
USER='utente'
PASSWD='passsssssssssword'

#mi sposto nella cartella di lavoro/salvataggio dei file generati
cd $WORKINGDIR

declare -a arr
I=0

for file in $( ls 048033* ) ; do
  if [ -s $file ]; then
     arr[i]=$file
  fi
  I=$((I + 1))
done

ELEMENTS=${#arr[@]};

if [ $ELEMENTS -gt 0 ]; then
    ftp -nv $HOST << CMD_SCRIPT
    user $USER $PASSWD
    ascii
    prompt
    mput 048033*.txt
    bye
    CMD_SCRIPT
fi
---------------------------------------------------------------------

Se lo eseguo ottengo:
./trsferimento.sh: line 56: syntax error: unexpected end of file

Se commento l'IF finale l'errore scompare ma dove sta questo errore?

Grazie a tutti 


Alessio Artini


Reply to: