#!/bin/bash

# USAGE
#   mkdesc <sc> <ll> <filenames>
#
# FUNCTION
#   The files are assumed to be text files beginning with the standard SAC
#   function specification header. The function name and the description of
#   each file are extracted and formatted as follows:
#   COLUMN  1      sc                                         ll
#           <name> <text......................................>
#                  <0 or more lines of additional text........>
#
#   If the function name consists of more than 'sc-2' characters the text in
#   the first line will begin to the right of column 'sc'.

if [ $# -lt 1 ] 
then
    echo "USAGE:"
    echo "  mkdesc <sc> <ll> <filenames>"
else
    args=("$@")
    for fname in "${args[@]:2}"
    do
    awk -f $saclib/bin/mkdesc.awk sc=$1 ll=$2 $fname
    done
fi
