Bonjour à tous.
Je voulais savoir comment récupérer une valeur de retour d'un programme externe perl dans un script shell.
Voici mon script shell
for dir_files in `ls ${LGD_DATA_DIR}/${DAT_STG_DFL_EOM_PREF}*`
do
perl lgd_get_mth_ref.pl ${dir_files} > mth_ref
done
Et mon script perl
$file = $ARGV[0] ;
$pos_mth_ref = index ($file,"20") ;
$mth_ref = substr($file, $pos_mth_ref, 6) ;
C'est tout bête mais je voulais récupérer $mth_ref dans mon programme shell. Cela ne fonctionne pas avec return..
Quelqu'un a une astuce ?
Merci d'avance.
Partager