#!/bin/bash ifile=$1 ofile=${ifile%.dat}'.fsgd' echo "GroupDescriptorFile 1" > ${ofile} echo "Title FACEHBI_LNG" >> ${ofile} echo "Class Main" >> ${ofile} long_qdec_table --qdec ${ifile} --cross --out tmp.cross awk '{print "Input",$1,"Main",$2,$3,$4,$5,$6}' tmp.cross | sed 's/Input fsid Main/Variables/;s/Female/0/;s/Male/1/' >> ${ofile} echo "0 0 0 0 0 1" > ${ifile%.dat}'.mtx'