[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Script BASH] récupérer une chaîne pour traitement



Le Thursday 01 November 2007, dexinou("dexinou" 
<dexinou@teledisnet.be>) a écrit:
> Salut,

Bonjour,

>
> echo -n "Nom de votre utilisateur? : "
>
> read USER

Attention, la variable USER est déjà définie par le système.

> VERIF=`grep $USER /etc/passwd | cut -d: -f1`
>
> if [ ! -e "$VERIF" ]; then
       ^^^^^^^^^
Ce serait plutôt '! -z "$VERIF".
 '-e' teste la présence d'un fichier et le '-z' vérfie la taille de 
la chaîne.
A+
-- 
http://www.glennie.fr
Everyone thinks of changing the world, but no one thinks of changing 
himself.



Reply to: