#!/bin/ksh
# 
#   **** make_file Ver. 1.0  12/21/01 - lgs ***********
#   **** Create a file of station numbers and DDs *****
#   **** For use by the quick_plot utility.       *****
#   ***************************************************
lineno=3
station=1
echo  
echo '**********************************************************'
echo '**This utility will create a file of Station Numbers and '
echo '**Data Descriptors to be used with the quick_plot utility'
echo 
echo  '   ** The output is a file named "plotfile".'
echo  '   ** If "plotfile" exists, it will be moved to "plotfile_old"'  
echo  
echo  '********** USE ^C AT ANY TIME TO END *******************'
echo
  if test -a plotfile
    then
    mv plotfile plotfile_old
  fi  
while ((station!=100))
do
echo 'ENTER STATION NUMBER: '"\c"
read station
echo  
echo 'PICK DATA DESCRIPTOR TO PLOT FROM LIST BELOW.'
echo
pick_dd -n $station | read ddid
echo
  if test $lineno = "3"
   then
   echo '# This file is named "plotfile"' > plotfile
   echo '# It is used by the quick_plot utility' >> plotfile
   echo $station >> plotfile
   echo $ddid >> plotfile
  fi
  if ((lineno > 3))
   then
   echo $station >> plotfile
   echo $ddid >> plotfile
  fi
((lineno=$lineno+1))
echo 'ADD STATION? (<CR> to continue, 99 to End): '"\c"
read station
echo  
((station=$station+1))
done
echo 'end' >> plotfile
