Retourner une chaine entre deux shell script
Pierre DUCAN
-
eric -
eric -
Bonjour,
Ma question est assez simple, mais je n'ai pas trouve de solution.
Tout ceci en en Shell script HP-UX
#Script1
./script2 PARAMETRE
EMAIL=$?
#script2
EMAIL="nom.prenom@email.com"
return $EMAIL
Comment faire pour retourner la valeur "EMAIL" au premier script?
Merci.
Ma question est assez simple, mais je n'ai pas trouve de solution.
Tout ceci en en Shell script HP-UX
#Script1
./script2 PARAMETRE
EMAIL=$?
#script2
EMAIL="nom.prenom@email.com"
return $EMAIL
Comment faire pour retourner la valeur "EMAIL" au premier script?
Merci.
2 réponses
-
eric@r2d2:~$ cat scrip*
#!/bin/bash
# script1
export EMAIL=$( ./script2 PARAMETRE )
echo $EMAIL
#!/bin/bash
# script2
export EMAIL="nom.prenom@email.com"
echo $EMAIL
a+
eric -
Salut,
Attention, dans le cas d'un shell Bourne les variables doivent être exportées en 2 temps :EMAIL="nom.prenom@email.com" export EMAIL
;-))
Z'@+...che.JP : Zen, my Nuggets ! ;-) Dans la vie on est toujours pauvre de savoir.