TY=$1
col=$2
opt=$3
shift ; shift ; shift

FS=`nof $TY`

case $TY in
mk|mks|spt) case $col in
              no|ref) ;;
                   *) case $opt in
-p|-lt) (cat $ENT/$TY.ent ; zex $FS | awkmkp `tscod $1` | tee $SRT) | ind | more ;;
-g|-gt) (cat $ENT/$TY.ent ; zex $FS | awkmkg `tscod $1` | tee $SRT) | ind | more ;;
 -i) (cat $ENT/$TY.ent ; zex $FS | awkmki `tscod $1` `tscod $2` | tee $SRT) |\
ind | more ;;
-e|-eq) (cat $ENT/$TY.ent ; zex $FS | grep -i "$*" | tee $SRT )| ind | more ;;
esac 
awk ' { print $1 } ' $SRT | sort -nu > $BTP/liste.noet
echo ' '
echo "	 Selected stars:  "`grep -c '^.' $BTP/liste.noet`
echo ' '
exit 0 ;; 
esac ;;
esac

pos=`awk ' $1 == cle {print $2,$3} ' cle=$col $DIC/pos.dic`
case $opt in
-p|-lt) (cat $ENT/$TY.ent ; zex $FS | awkp $pos $1 | tee $SRT ) | more ;;
-g|-gt) (cat $ENT/$TY.ent ; zex $FS | awkg $pos $1 | tee $SRT ) | more ;;
-i) (cat $ENT/$TY.ent ; zex $FS | awkg $pos $1 | awkp $pos $2 |\
    tee $SRT )| ind | more ;;
-e|-eq) (cat $ENT/$TY.ent ; zex $FS | awke $pos $1 | tee $SRT ) | page ;;
-n|-ne) (cat $ENT/$TY.ent ; zex $FS | awkn $pos $1 | tee $SRT ) | page ;;
esac 

awk ' { print $1 } ' $SRT | sort -nu > $BTP/liste.noet
echo ' '
echo "	 Selected stars:  "`grep -c '^.' $BTP/liste.noet`
echo ' '
