Fermer script shell...

Loo -  
 Loo -
Bonjour, alors voila, je voudrais savoir comment je peux fermer un script shell a partir d'un autre appelé par le premier ^^, je m'explique :

#!/bin/bash
#
./monscript2.sh
exit 0;

#!/bin/bash
#
FERMER ./monscript1.sh
exit 0;
Configuration: Linux
Firefox 3.5.7

2 réponses

  1. Flachy Joe Messages postés 2303 Statut Membre 261
     
    Il faut récupérer le pid du premier script (variable $$ à passer au second script) et envoyer un kill :
    script 1
    #!/bin/bash
    #
    ./monscript2.sh $$
    exit 0; 
    


    script 2
    #!/bin/bash
    #
    kill $1
    exit 0;
    


    Bonne continuation !
    0