opt=$1
shift

amas=`setit`
noet=`echo $3 | awk ' {printf"%04d",$1} '`
case $LNG in
  fr) echo " Etoile $3 de $amas " > .T/e$noet.bin ;;
  eng) echo " Star $3 in $amas " > .T/e$noet.bin ;;
esac

case $opt in
 -sel|-sel1) awkbina < .T/e$noet.lst >> .T/e$noet.bin ;;
 -sel2) grep A .T/e$noet.lst | awkbin2 >> .T/e$noet.bin
        echo ' ' >> .T/e$noet.bin
        grep B .T/e$noet.lst | awkbin2 >> .T/e$noet.bin ;;
esac
echo ' ' >> .T/e$noet.bin
echo ' ' >> .T/e$noet.bin

echo ' '
echo ' '
echo ' '

case $LNG in
  fr) echo -n " Voulez-vous editer le fichier (o/n) ?  ";;
  eng) echo -n " Do you want to edit the file (y/n) ?  ";;
esac
read rep
case $rep in
o|y) $EDT .T/e$noet.bin ;;
""|n) ;;
esac

clear
case $LNG in
  fr) echo " Recherche de periode pour l'etoile $3 dans $amas";;
  eng) echo " Period search for the star $3 in $amas";;
esac
echo ' '
lucke $noet

clear
echo ' '
case $LNG in
  fr) echo -n " Voulez-vous supprimer les fichiers crees (o/n/c) ?  ";;
  eng) echo -n " Do you want to remove the created files (y/n/c) ?  ";;
esac
read sup
case $sup in
o|y) rm .T/e$noet.* ;;
n) ;;
c) rm -i .T/e$noet.* ;;
esac
