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.

Capitolo 16. Re<strong>di</strong>rezione I/O<br />

Nomefile=nomi.data # È il file predefinito, se non ne viene<br />

#+ specificato alcuno.<br />

else<br />

Nomefile=$1<br />

fi<br />

#+ Nomefile=${1:-nomi.data}<br />

# può sostituire la verifica precedente (sostituzione <strong>di</strong> parametro).<br />

conto=0<br />

echo<br />

while [ "$nome" != Smith ] # Perché la variabile $nome è stata usata<br />

#+ con il quoting?<br />

do<br />

read nome # Legge da $Nomefile invece che dallo st<strong>di</strong>n.<br />

echo $nome<br />

let "conto += 1"<br />

done

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

Saved successfully!

Ooh no, something went wrong!