#!/bin/csh -f
#++++++++++++++++
#.IDENTIFICATION getocl
#.LANGUAGE       C_shell
#.AUTHOR         Francois Ochsenbein <francois@astro.u-strasbg.fr>
#.ENVIRONMENT    CDS Catalogues Service
#.KEYWORDS       
#.VERSION  1.0   19-Sep-1998
#.PURPOSE        Find out the details from "make.dat" for a cluster
#.COMMENTS       The program accepts the following argument:
#	Arg#1 (required): OCL designation
#----------------

cd `dirname $0` 
set f1 = main.dat	# File to read

#### Look for existence of files
set cat1 = cat
if (-r $f1.Z)	set cat1 = zcat
if (-r $f1.gz)	set cat1 = gzcat

#### Write out the Title
echo '\begin{PRE}'
#$cat1 $f1 | head -1 ; echo "\hr"
$cat1 $f1 | gawk "/^OCL/{if(k>0) exit(0)} /^$* /{k=1}"'\
    NR==1{t="\\par\\hr " $0 "\\hr" } \
    {if (k<1) next; if(k==3) print t; k++; print }'
echo '\end{PRE}'
exit 0
#######################################################################
