[gull] Partager une variable entre deux scripts shell

Nicolas Borboën nbo at donax.ch
Wed Nov 8 15:13:41 CET 2006


Bonjour à tous,
J'ai deux scripts shell, l'un appel l'autre. J'aimerais récupérer une
variable de l'autre dans le premier, c'est possible?

Ci-dessous mes script de test (aussi dispo ici:
http://paste.ubuntu-nl.org/30623/)

##### SCRIPT 1
#!/bin/sh
echo "begin script 1"
./script2.sh
echo "VAR BAR: $BAR"
echo "end script 1"


##### SCRIPT 2
#!/bin/sh
echo "begin script 2"
BAR="foo"
echo "VAR BAR: $BAR"
export $BAR
echo "end script 2"


PS: m'excuse d'avance au cas ou cela coulerait de source pour certains :-p



More information about the gull mailing list