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.

getty<br />

agetty<br />

mesg<br />

wall<br />

uname<br />

Capitolo 13. Coman<strong>di</strong> <strong>di</strong> sistema e d’amministrazione<br />

Il processo <strong>di</strong> inizializzazione <strong>di</strong> un terminale utilizza getty o agetty per l’impostazione del login <strong>di</strong><br />

un utente. Questi coman<strong>di</strong> non vengono usati negli script <strong>di</strong> shell. Il loro corrispondente per lo<br />

<strong>scripting</strong> è stty.<br />

Abilita o <strong>di</strong>sabilita l’accesso in scrittura al terminale dell’utente corrente. Disabilitando l’accesso si<br />

impe<strong>di</strong>sce ad un altro utente della rete <strong>di</strong> scrivere su quel terminale.<br />

Suggerimento: Può risultare molto fasti<strong>di</strong>oso veder comparire improvvisamente un messaggio<br />

d’or<strong>di</strong>nazione <strong>di</strong> una pizza nel bel mezzo <strong>di</strong> un file <strong>di</strong> testo su cui si sta lavorando. Su una rete<br />

multi-utente, potrebbe essere desiderabile <strong>di</strong>sabilitare l’accesso in scrittura al terminale quando<br />

si ha bisogno <strong>di</strong> evitare qualsiasi interruzione.<br />

È l’acronimo <strong>di</strong> “ write all”, vale a <strong>di</strong>re, invia un messaggio ad ogni terminale <strong>di</strong> ciascun utente<br />

collegato alla rete. Si tratta, innanzi tutto, <strong>di</strong> uno strumento dell’amministratore <strong>di</strong> sistema, utile, per<br />

esempio, quando occorre avvertire tutti gli utenti che la sessione dovrà essere arrestata a causa <strong>di</strong> un<br />

determinato problema (ve<strong>di</strong> Esempio 17-1).<br />

bash$ wall Tra 5 minuti Il sistema verrà sospeso per manutenzione!<br />

Broadcast message from ecobel (pts/1) Sun Jul 8 13:53:27 2001...<br />

Tra 5 minuti il sistema verrà sospeso per manutenzione!<br />

Nota: Se l’accesso in scrittura <strong>di</strong> un particolare terminale è stato <strong>di</strong>sabilitato con mesg, allora<br />

wall non potrà inviare nessun messaggio a quel terminale.<br />

Informazioni e statistiche<br />

Visualizza allo stdout le specifiche <strong>di</strong> sistema (SO, versione del kernel, ecc). Invocato con<br />

l’opzione -a, fornisce le informazioni in forma dettagliata (ve<strong>di</strong> Esempio 12-5). L’opzione -s<br />

mostra solo il tipo <strong>di</strong> Sistema Operativo.<br />

bash$ uname -a<br />

Linux localhost.localdomain 2.2.15-2.5.0 #1 Sat Feb 5 00:13:43 EST 2000 i686 unknown<br />

352

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

Saved successfully!

Ooh no, something went wrong!