1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| aff_menu(){
! [ -f "$1" ] && { return 1 ; }
echo -n \\n
while [ ${temp_aff_menu-0} -lt $# ] ; do
temp_aff_menu=$(( temp_aff_menu + 1 ))
echo -n "$temp_aff_menu : "
eval echo \$$temp_aff_menu
done
echo \\n"quel fichier ? [ 1 - $# ]"
echo -n \\n"votre choix : "
}
choix_menu(){
read temp_choix_menu
case $temp_choix_menu in
[1-$#]) echo $(eval echo \$"$temp_choix_menu") ;;
*) return 1
esac
}
type_file=*.cue
aff_menu $type_file
[ $? -eq 1 ] && { echo ko ; exit ;} || retour=$(choix_menu $type_file)
[ $? -eq 1 ] && { echo ko ; exit ;} || echo $retour |