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.

setterm<br />

tset<br />

setserial<br />

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

Imposta alcuni attributi del terminale. Questo comando scrive una stringa nello stdout del proprio<br />

terminale con la quale mo<strong>di</strong>fica il comportamento del terminale stesso.<br />

bash$ setterm -cursor off<br />

bash$<br />

setterm può essere usato in uno script per mo<strong>di</strong>ficare le modalità: <strong>di</strong> visualizzazione <strong>di</strong> un testo allo<br />

stdout, anche se esistono certamente strumenti migliori per questo scopo.<br />

setterm -bold on<br />

echo ciao in grassetto<br />

setterm -bold off<br />

echo ciao normale<br />

Mostra o inizializza le impostazioni del terminale. È una versione meno potente <strong>di</strong> stty.<br />

bash$ tset -r<br />

Terminal type is xterm-xfree86.<br />

Kill is control-U (^U).<br />

Interrupt is control-C (^C).<br />

Imposta o visualizza i parametri <strong>di</strong> una porta seriale. Questo comando deve essere eseguito<br />

dall’utente root e si trova, <strong>di</strong> solito, in uno script <strong>di</strong> avvio del sistema.<br />

# Dallo script /etc/pcmcia/serial:<br />

IRQ=‘setserial /dev/$DEVICE | sed -e ’s/.*IRQ: //’‘<br />

setserial /dev/$DEVICE irq 0 ; setserial /dev/$DEVICE irq $IRQ<br />

351

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

Saved successfully!

Ooh no, something went wrong!