A voir également:
- Expression reguliere Script shell
- Script vidéo youtube - Guide
- Classic shell windows 11 - Télécharger - Personnalisation
- Mas script - Accueil - Windows
- Ghost script - Télécharger - Polices de caractères
- Classic shell c'est quoi ✓ - Forum Windows 10
1 réponse
jisisv
Messages postés
3645
Date d'inscription
dimanche 18 mars 2001
Statut
Modérateur
Dernière intervention
15 janvier 2017
934
8 mars 2004 à 15:29
8 mars 2004 à 15:29
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.
8 mars 2004 à 16:02
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