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.

|<br />

|=<br />

~<br />

!<br />

^<br />

^=<br />

&&<br />

||<br />

OR bitwise<br />

“OR bitwise-uguale”<br />

complemento bitwise<br />

NOT bitwise<br />

XOR bitwise<br />

“XOR bitwise-uguale”<br />

operatori logici<br />

and (logico)<br />

Capitolo 8. Operazioni ed argomenti correlati<br />

if [ $con<strong>di</strong>zione1 ] && [ $con<strong>di</strong>zione2 ]<br />

# Uguale a: if [ $con<strong>di</strong>zione1 -a $con<strong>di</strong>zione2 ]<br />

# Restituisce vero se entrambe, con<strong>di</strong>zione1 e con<strong>di</strong>zione2, sono vere...<br />

if [[ $con<strong>di</strong>zione1 && $con<strong>di</strong>zione2 ]] # Funziona anche così.<br />

# Notate che l’operatore && non è consentito nel costrutto [ ... ].<br />

Nota: && può essere utilizzato, secondo il contesto, in una lista and per concatenare dei<br />

coman<strong>di</strong>.<br />

or (logico)<br />

if [ $con<strong>di</strong>zione1 ] || [ $con<strong>di</strong>zione2 ]<br />

# Uguale a: if [ $con<strong>di</strong>zione1 -o $con<strong>di</strong>zione2 ]<br />

# Restituisce vero se è vera o con<strong>di</strong>zione1 o con<strong>di</strong>zione2 ...<br />

if [[ $con<strong>di</strong>zione1 || $con<strong>di</strong>zione2 ]] # Funziona anche così.<br />

89

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

Saved successfully!

Ooh no, something went wrong!