Shell Unix
Kuzco
-
kuzco -
kuzco -
Salut les potos!
ce message c'est pr les as du korn shell! :-)
j'ai un shell principal qui appelle un autre shell secondaire...mon probléme c'est que je sais pas comment récuperer des variables( données comprise) du second shell afin de pouvoir les manipuler dans le shell principal une fois le second shell terminé...
Merci d'avance pr ton aide!
ce message c'est pr les as du korn shell! :-)
j'ai un shell principal qui appelle un autre shell secondaire...mon probléme c'est que je sais pas comment récuperer des variables( données comprise) du second shell afin de pouvoir les manipuler dans le shell principal une fois le second shell terminé...
Merci d'avance pr ton aide!
A voir également:
- Shell Unix
- Classic shell - Télécharger - Personnalisation
- Fichier executable unix ✓ - Forum MacOS
- Secure shell - Télécharger - Divers Web & Internet
- Unix scrabble ✓ - Forum loisirs/vie pratique
- Shell infrastructure host c'est quoi - Guide
4 réponses
je pense aussi que export est ta solution
export:
communique toutes les variables définies dans le shell appellant la commande vers tous les autres shell utilisés
je crois ;-)
export:
communique toutes les variables définies dans le shell appellant la commande vers tous les autres shell utilisés
je crois ;-)
j'ai un truc bizarre qd meme qu'il se passe...
qd je lance mon shell principal, ma variable n'existe pas.
exho $var renvoie rien.
(jusqu'ici tout va bien)
j'appelle un autre shell
. toto.sh
je fais un traitement
je fais mon fameux export
export var=1979
je reviens dans mon shell principal et la
echo $var renvoie rien du tout...la variable est null
on dirait que l'export ne sait pas fait et dc n'a pas été pris en compte par le shell principal...cheloud non?
merci à celui qui saurait m'aider.:-p
lance collecte avant : 1400
export NUMERO_CHARGEMENT_NEW=1400
lance collecte apres : 1400
--------------------------------
Termine sans erreur - chargement 1400 en cours de COLLECTE
--------------------------------
*** retour au shell principal d'alimentation : ./tr_lance_traca.sh
retour dans lance trace :
103 - Fichier .sav es-tu là?
je verifie si le fichier DEV_.sav est présent.....
qd je lance mon shell principal, ma variable n'existe pas.
exho $var renvoie rien.
(jusqu'ici tout va bien)
j'appelle un autre shell
. toto.sh
je fais un traitement
je fais mon fameux export
export var=1979
je reviens dans mon shell principal et la
echo $var renvoie rien du tout...la variable est null
on dirait que l'export ne sait pas fait et dc n'a pas été pris en compte par le shell principal...cheloud non?
merci à celui qui saurait m'aider.:-p
lance collecte avant : 1400
export NUMERO_CHARGEMENT_NEW=1400
lance collecte apres : 1400
--------------------------------
Termine sans erreur - chargement 1400 en cours de COLLECTE
--------------------------------
*** retour au shell principal d'alimentation : ./tr_lance_traca.sh
retour dans lance trace :
103 - Fichier .sav es-tu là?
je verifie si le fichier DEV_.sav est présent.....
On peut exporter une variable vers un shell enfant mais pas l'inverse
[johand@zoot] ~/tmp $echo $myvar
[johand@zoot] ~/tmp $myvar="HELLO"
[johand@zoot] ~/tmp $echo $myvar
HELLO
[johand@zoot] ~/tmp $sh
[johand@zoot] ~/tmp $echo $myvar
[johand@zoot] ~/tmp $exit
exit
[johand@zoot] ~/tmp $export myvar
[johand@zoot] ~/tmp $sh
[johand@zoot] ~/tmp $echo $myvar
HELLO
[johand@zoot] ~/tmp $exit
exit
A la limite placer les variables dans un fichier
[johand@zoot] ~/tmp $unset myvar
[johand@zoot] ~/tmp $sh
[johand@zoot] ~/tmp $echo "myvar='Hello'" > monfic
[johand@zoot] ~/tmp $exit
exit
[johand@zoot] ~/tmp $echo $myvar
[johand@zoot] ~/tmp $eval $(cat monfic)
[johand@zoot] ~/tmp $echo $myvar
Hello
Johan
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.
[johand@zoot] ~/tmp $echo $myvar
[johand@zoot] ~/tmp $myvar="HELLO"
[johand@zoot] ~/tmp $echo $myvar
HELLO
[johand@zoot] ~/tmp $sh
[johand@zoot] ~/tmp $echo $myvar
[johand@zoot] ~/tmp $exit
exit
[johand@zoot] ~/tmp $export myvar
[johand@zoot] ~/tmp $sh
[johand@zoot] ~/tmp $echo $myvar
HELLO
[johand@zoot] ~/tmp $exit
exit
A la limite placer les variables dans un fichier
[johand@zoot] ~/tmp $unset myvar
[johand@zoot] ~/tmp $sh
[johand@zoot] ~/tmp $echo "myvar='Hello'" > monfic
[johand@zoot] ~/tmp $exit
exit
[johand@zoot] ~/tmp $echo $myvar
[johand@zoot] ~/tmp $eval $(cat monfic)
[johand@zoot] ~/tmp $echo $myvar
Hello
Johan
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.