A voir également:
- Expression reguliere Script shell
- Classic shell - Télécharger - Personnalisation
- Script vidéo youtube - Guide
- Ghost script - Télécharger - Polices de caractères
- Expression écrite cm1 cm2 télécharger gratuit - Télécharger - Éducatifs
- Mas script - Accueil - Windows
1 réponse
Essaye quelque chose du genre:
machaine="azerty" ;echo $machaine |grep '^[[:alnum:]]*$' >/dev/null ; echo $?
La variable de retour $? contient
man grep
<snip>
DIAGNOSTICS
Normally, exit status is 0 if matches were found, and 1 if no matches were found. (The -v option inverts the sense of the exit status.) Exit status is 2 if there were syntax errors in the pattern, inaccessible input files, or other system errors.
</snip>
Johan
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.
machaine="azerty" ;echo $machaine |grep '^[[:alnum:]]*$' >/dev/null ; echo $?
La variable de retour $? contient
man grep
<snip>
DIAGNOSTICS
Normally, exit status is 0 if matches were found, and 1 if no matches were found. (The -v option inverts the sense of the exit status.) Exit status is 2 if there were syntax errors in the pattern, inaccessible input files, or other system errors.
</snip>
Johan
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.
entre temps j'avais trouvé :
echo "\tNom de l'utilisateur a creer (\"quit\" pour sortir): \c"
read NM_USR
b=`expr match "$NM_USR" '\([a-zA-Z0-9/-]*\)'`
if [ "$NM_USR" != "$b" ]
then
echo "syntaxe error"
else
echo "syntaxe ok"
fi;
Par contre je n'arrive pas à integrer l'apostrophe comme caractere dans mon expression reguliere
As tu une idée?
Merci
Thetontonben