#! /bin/sh

if [ -z "$1" ] || [ -z "$2" ]
  then
    echo ""
    echo "a2c:    Script to run the 'awk2c' translator on a given AWK"
    echo "        program and produce the converted C program in a user-specified"
    echo "        file (awk2c should be accessible)"
    echo ""
    echo "USAGE:  a2c  INPUT_AWK_FILE  OUTPUT_C_FILE  [ awk2c options ]"
    echo "-----------------------------------------------------------------------"
    awk2c
    exit 1
fi

if [ ! -e "$1" ]
  then
    echo "ERROR!  File "$1" does not exist"
    exit 2
fi

awk2c $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} -f $1 \
| indent -npcs > $2
