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.

$FUNCNAME<br />

$GLOBIGNORE<br />

$GROUPS<br />

$HOME<br />

$HOSTNAME<br />

nome della funzione corrente<br />

xyz23 ()<br />

{<br />

echo "$FUNCNAME è in esecuzione." # xyz23 è in esecuzione.<br />

}<br />

xyz23<br />

Capitolo 9. Variabili riviste<br />

echo "NOME FUNZIONE = $FUNCNAME" # NOME FUNZIONE =<br />

# Valore nullo all’esterno della funzione.<br />

un elenco <strong>di</strong> nomi <strong>di</strong> file da escludere dalla ricerca nel globbing<br />

i gruppi a cui appartiene l’utente corrente<br />

È l’elenco (array) dei numeri id dei gruppi a cui appartiene l’utente corrente, così come sono<br />

registrati nel file /etc/passwd.<br />

root# echo $GROUPS<br />

0<br />

root# echo ${GROUPS[1]}<br />

1<br />

root# echo ${GROUPS[5]}<br />

6<br />

<strong>di</strong>rectory home dell’utente, <strong>di</strong> solito /home/nomeutente (ve<strong>di</strong> Esempio 9-14)<br />

In fase <strong>di</strong> boot, il comando hostname, presente in uno script init, assegna il nome del sistema.<br />

Tuttavia è la funzione gethostname() che imposta la variabile interna <strong>Bash</strong> $HOSTNAME. Ve<strong>di</strong><br />

anche Esempio 9-14.<br />

97

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

Saved successfully!

Ooh no, something went wrong!