On Tuesday 25 October 2005 11:25, elio bellini wrote:
> salve gente!
> mi servirebbe un aiuto, come posso formulare una condizione if che dice
> questo: se l'utente pippo esiste in /etc/passwd allora non fare niente,
> se non esiste fai questo comando....

Per esempio così:

    #!/bin/bash

    UTENTE="nome"
    RICERCA="`getent passwd $UTENTE`"

    if [ "$RICERCA" == "" ]; then
        echo "$UTENTE non trovato";
    fi


Saluti.



alfredo

Rispondere a