Problème de syntaxe Expr et expression.
obiwankennedy
-
jipicy Messages postés 41342 Statut Modérateur -
jipicy Messages postés 41342 Statut Modérateur -
BONJOUR
Voici, mon problème dans une variable j'ai ceci
je fais un expr avec cette expression
mon but est de recupere salut\;toi.txt
celà marche mais celà affiche une erreur "
expr: warning: unportable BRE: `^;*[0-9]+;\(.*\)': using `^' as the first charac
er
et ensuite pour la ligne suivante se ne marche plus du tout
merci
Voici, mon problème dans une variable j'ai ceci
ligne=;;;;0;salut\;toi.txt
je fais un expr avec cette expression
ligne2=`expr "$ligne" : '^;*[0-9]+;\(.*\)'`
mon but est de recupere salut\;toi.txt
celà marche mais celà affiche une erreur "
expr: warning: unportable BRE: `^;*[0-9]+;\(.*\)': using `^' as the first charac
er
et ensuite pour la ligne suivante se ne marche plus du tout
ligne=4096;ind\;ex.php3
merci
A voir également:
- Problème de syntaxe Expr et expression.
- Expression écrite cm1 cm2 télécharger gratuit - Télécharger - Éducatifs
- Microsoft expression encoder - Télécharger - Divers Utilitaires
- Expression de recherche - Guide
- Avoir du ping expression ✓ - Forum Réseau
- Syntaxe precise - Forum Mail
4 réponses
J'avais z'oublié l'exemple ;-))
[jp@Mandrake tmpfs]$ ligne=";;;;0;salut\;toi.txt" [jp@Mandrake tmpfs]$ echo $ligne ;;;;0;salut\;toi.txt [jp@Mandrake tmpfs]$ ligne2=`expr "$ligne" : ".*[0-9];\(.*\)"` [jp@Mandrake tmpfs]$ echo $ligne2 salut\;toi.txt [jp@Mandrake tmpfs]$ ligne="4096;ind\;ex.php3" [jp@Mandrake tmpfs]$ echo $ligne 4096;ind\;ex.php3 [jp@Mandrake tmpfs]$ ligne2=`expr "$ligne" : ".*[0-9];\(.*\)"` [jp@Mandrake tmpfs]$ echo $ligne2 ind\;ex.php3 [jp@Mandrake tmpfs]$au cas z'ou il en faudrait un ;-))