Objectif
Exécuter un script Perl et un script Python à partir d’un script shell.
Le script Perl
$ nl scriptperl.pl 1 #! /usr/bin/perl 2 print "Je suis un script Perl" ; 3 exit 0 ;
Le script Python
$ nl scriptpython.py 1 #! /usr/bin/python 2 print "Je suis un script Python" 3 exit(0)
Le script shell
$ nl test_scripts.sh 1 # Execution du script Python 2 if scriptpython.py > /dev/null 3 then 4 echo "Script Python termine avec succes" 5 else 6 echo "Script Python termine avec echec" 7 fi 8 # Execution du script Perl 9 if scriptperl.pl > /dev/null 10 then 11 echo "Script Perl termine avec succes" 12 else 13 echo "Script Perl termine avec echec" 14 fi
Environnement
Dans notre exemple, ...
Abonnement
tous les livres et vidéos ENI en illimité sans engagement
du livre imprimé ou du livre numérique