#!/bin/bash

# -------------------------------------------------------
# RPC Project :
# Run RPC_give_rff_param
# P. Robert, ScientiDev, January 2021
# -------------------------------------------------------

appli=`basename $0`
appli36=`echo "$appli                                 " | cut -c1-36`
Narg=1
echo " -------------------------------------------------------------------"
echo $appli $*


if( (test $# = 1 ) && (test $1 = -h ) ) ; then hh=1 ; else hh=0 ; fi

if test $# != $Narg || test $hh = 1
   then
   echo "$appli : give header of a RFF file"
   echo "$appli   require $Narg argument(s), ex:"
   echo "$appli   toto.rff"
   echo "    toto.rff : name of a RFF file"
   echo ""
   if test $hh = 1 ; then exit 0 ; fi
   echo "$appli36 : *** ERROR ! Command aborted." >&2
   exit 1
fi

echo '#-----------------------------------------------------------------------'
sed -n '/START MANDATORY_PARAMETERS/,/PAR EXPERIMENT_PI_MAIL/p' $1
echo
echo '+ other optional parameters less important'
echo '#-----------------------------------------------------------------------'
sed -n '/START CONSTANT_DATA/,/END CONSTANT_DATA/p' $1
echo '#-----------------------------------------------------------------------'
