Probleme avec une declaration de variable

Résolu/Fermé
ogranyanos Messages postés 18 Date d'inscription mardi 12 avril 2011 Statut Membre Dernière intervention 30 mai 2011 - 13 avril 2011 à 16:04
ogranyanos Messages postés 18 Date d'inscription mardi 12 avril 2011 Statut Membre Dernière intervention 30 mai 2011 - 13 avril 2011 à 16:11
Bonjour,

mon problem est que la commande passe bien ( c est censé m afficher 100)

[root@nopfb022 VDKJ2614]# echo PI-TUX-TUX100P-RDG00R00C00.SIG | awk -F - '{ print $3}' | tr [A-Z] " " | awk '{ print $1}'
100

mais quand je la declare en variable ca plante

[root@nopfb022 VDKJ2614]# c=echo PI-TUX-TUX100P-RDG00R00C00.SIG | awk -F - '{ print $3}' | tr [A-Z] " " | awk '{ print $1}'
-bash: PI-TUX-TUX100P-RDG00R00C00.SIG: command not found


2 réponses

zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 6 408
13 avril 2011 à 16:06
Salut,

VAR="$(commande)"

Autrement dit :
c="$(echo PI-TUX-TUX100P-RDG00R00C00.SIG | awk -F - '{ print $3}' | tr [A-Z] " " | awk '{ print $1}')"
2
ogranyanos Messages postés 18 Date d'inscription mardi 12 avril 2011 Statut Membre Dernière intervention 30 mai 2011
13 avril 2011 à 16:11
thanks a lot !!
0