#!/bin/sh
database=$1
tracklets=$2

while read id; do
    echo "/usr/bin/mysql -umops -pmops -h mops01 -e 'select t.tracklet_id, v_ra, v_dec, v_tot, v_ra_sigma, v_dec_sigma, pos_ang_deg, gcr_arcsec, ext_epoch, ext_ra, ext_dec, ext_mag, probability, digest, status, known_id, field_id, known_name from $1.tracklets t left join $1.known using (known_id) where t.tracklet_id=$id"
    /usr/bin/mysql -umops -pmops -h mops01 -e "select t.tracklet_id, v_ra, v_dec, v_tot, v_ra_sigma, v_dec_sigma, pos_ang_deg, gcr_arcsec, ext_epoch, ext_ra, ext_dec, ext_mag, probability, digest, status, known_id, field_id, known_name from $1.tracklets t left join $1.known using (known_id) where t.tracklet_id=$id"
done < $2
