Exercice Linux 2 corrigé la programmation en shell

Le fichier papa contient :
#!/bin/bash
echo avant appel du fils
echo TERM = $TERM
echo PWD = $PWD
./fiston
echo apres appel du fils
echo TERM = $TERM
echo PWD = $PWD
Le fichier fiston contient :
#!/bin/bash
echo je suis le fils
echo mon heritage est:
echo TERM = $TERM
echo PWD = $PWD
echo je change
TERM=’riendutout’
cd /tmp
 echo TERM = $TERM
echo PWD = $PWD
echo je me termine
L’exécution donne les résultats suivants :
kyle> ./papa
avant appel du fils
TERM vt100
PWD /home/moi/testunix
je suis le fils
mon heritage est:
TERM vt100
PWD /home/moi/testunix
je change
TERM riendutout
PWD /tmp
je me termine
apres appel du fils
TERM vt100
PWD /home/moi/testunix
Kyle>

Télécharger aussi :

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *