11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

E_ERR_ARG=65<br />

if [ -z "$1" ]<br />

then<br />

echo "Utilizzo: ‘basename $0‘ nomefile-da-caricare"<br />

exit $E_ERR_ARG<br />

fi<br />

Capitolo 17. Here document<br />

Nomefile=‘basename $1‘ # Toglie il percorso dal nome del file.<br />

Server="ibiblio.org"<br />

Directory="/incoming/Linux"<br />

# Questi dati non dovrebbero essere co<strong>di</strong>ficati nello script,<br />

#+ ma si dovrebbe avere la possibilità <strong>di</strong> cambiarli fornendoli come<br />

#+ argomenti da riga <strong>di</strong> comando.<br />

Password="vostro.in<strong>di</strong>rizzo.e-mail" # Sostituitelo con quello appropriato.<br />

ftp -n $Server

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!