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 />

# Suggerito da Heiner Steven<br />

#+ come espe<strong>di</strong>ente in quelle situazioni in cui un ciclo re<strong>di</strong>retto<br />

#+ viene eseguito come subshell e, quin<strong>di</strong>, le variabili all’interno del ciclo<br />

#+ non conservano i loro valori dopo che lo stesso è terminato.<br />

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

then<br />

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

#+ specificato alcuno.<br />

else<br />

Nomefile=$1<br />

fi<br />

exec 3

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

Saved successfully!

Ooh no, something went wrong!