Fermer script shell...

Fermé
Loo - 21 janv. 2010 à 17:22
 Loo - 21 janv. 2010 à 18:50
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;
A voir également:

2 réponses

Flachy Joe Messages postés 2103 Date d'inscription jeudi 16 septembre 2004 Statut Membre Dernière intervention 21 novembre 2023 259
21 janv. 2010 à 18:34
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
merci, c'est super !!
0