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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

-p<br />

-h<br />

-L<br />

-S<br />

-t<br />

-r<br />

-w<br />

-x<br />

-g<br />

-u<br />

il file è una pipe<br />

il file è un link simbolico<br />

il file è un link simbolico<br />

il file è un socket<br />

il file (descrittore) è associato ad un terminale<br />

Capitolo 7. Verifiche<br />

Questa opzione può essere utilizzata per verificare se lo st<strong>di</strong>n ([ -t 0 ]) o lo stdout ([ -t<br />

1 ]) in un dato script è un terminale.<br />

il file ha il permesso <strong>di</strong> lettura (per l’utente che esegue la verifica)<br />

il file ha il permesso <strong>di</strong> scrittura (per l’utente che esegue la verifica)<br />

il file ha il permesso <strong>di</strong> esecuzione (per l’utente che esegue la verifica)<br />

è impostato il bit set-group-id (sgid) su un file o <strong>di</strong>rectory<br />

Se una <strong>di</strong>rectory ha il bit sgid impostato, allora un file creato in quella <strong>di</strong>rectory appartiene al<br />

gruppo proprietario della <strong>di</strong>rectory, non necessariamente al gruppo dell’utente che ha creato il file.<br />

Può essere utile per una <strong>di</strong>rectory con<strong>di</strong>visa da un gruppo <strong>di</strong> lavoro.<br />

è impostato il bit set-user-id (suid) su un file<br />

Un file binario <strong>di</strong> proprietà <strong>di</strong> root con il bit set-user-id impostato funziona con i privilegi <strong>di</strong><br />

root anche quando è invocato da un utente comune. 1 È utile con eseguibili (come pppd e cdrecord)<br />

che devono accedere all’hardware del sistema. Non impostando il bit suid, questi eseguibili non<br />

potrebbero essere invocati da un utente <strong>di</strong>verso da root.<br />

-rwsr-xr-t 1 root 178236 Oct 2 2000 /usr/sbin/pppd<br />

71

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

Saved successfully!

Ooh no, something went wrong!