dir1=rpcli
dir2=clien
APPLDIR=/ctn
DATADIR=/usr/ctn
t=/tmp/t
r1=$t.r1
r2=$t.r2
x1=$t.x1
x2=$t.x2
cat $APPLDIR/$dir1/$dir1.t[01] > $x1
cat $APPLDIR/$dir2/$dir2.t[01] > $x2
par=`awk -F: ' BEGIN {getline;k=0 }
FILENAME == ARGV[1] { he[$1]=sprintf("h%.2d",h++) }
FILENAME == ARGV[2] { he[$1]=sprintf("d%.2d",d++) }
FILENAME == ARGV[3] && ($3+0<30 ||$3+0>49) {
if (!k) getline
k=1
printf "%s ",he[$1] }
{
} ' $APPLDIR/$dir2/*t[01]  $x1 `
echo $par
cd $DATADIR/$dir2
echo hdsort $APPLDIR/$dir2/$dir2 $par
hdsort $APPLDIR/$dir2/$dir2 $par > $DATADIR/$dir1/HEAD
wc -l $DATADIR/$dir1/HEAD > $DATADIR/$dir1/INFO 
