setup_parfile (version 1.0)

You can also look at:
#! /usr/bin/ksh

###########################################################################
#
# 
# SYNTAX: setup_parfile parfile_path param=value param=value...
#
# DESCRIPTION: This utility copies a parfile into the working directory,
# DESCRIPTION: resets all parameters from asking mode to hidden mode,
# DESCRIPTION: and sets parameter values as specified
#
# VERSION: 1.0
#
# HISTORY: 0.0 -> 1.0 10/9/96
# HISTORY: also change ,q, and ,ql, modes to ,h,
#
#
##############################################################################
#DEBUG=1

parpath=$1

parfile=${parpath##*/}

########################
# debugging output
#########################
if [ -n "$DEBUG" ]; then
     echo ${0##*/}: parpath=$parpath
     echo ${0##*/}: parfile=$parfile
fi


####################################################################
# copy over the par file and reset from asking mode to hidden mode
####################################################################
rm -f $parfile
sed -e 's/,a,/,h,/' $parpath |\
sed -e 's/,q,/,h,/'          |\
sed -e 's/,ql,/,h,/' > $parfile 2>stderr.log
$UTIL/exit_test $? $0 1 "Getting parfile $parpath"
if [ -s stderr.log ]; then
     $UTIL/log_entry "Standard Error output from sed while copying $parfile"
     $UTIL/file_to_log stderr.log
fi
rm -f stderr.log

#############################################
# loop through arguments and set parameters
#############################################
shift
typeset -i i=0
while [ $# -gt 0 ]; do

     param=${1%%=*}
     value="${1#*=}"

     ########################
     # debugging output
     #########################
     if [ -n "$DEBUG" ]; then
          echo ${0##*/}: param=$param
          echo ${0##*/}: value=$value
     fi

     $UTIL/set_parameter ./${parfile} $param "$value"

     shift
done






exit 0