#!/bin/sh #echo "Content-type: text/csv\n" # set environment variables. . /u/catcom/catcom_vars OPDIRCSVFILE="DOD00opdir.csv" ################################### # set working dir cd /u/catcom/t21web/direnq ################################### # get lock #LOCKFILE="/tmp/t21websql.lok" #while true #do # if [ ! -f "$LOCKFILE" ]; then # break; # fi # sleep 2 #done #touch $LOCKFILE ########################################################################### tmpfile1="/tmp/webopdirtmp1_$$.unl" tmpfile2="/tmp/webopdirtmp2_$$.unl" rm -f "$tmpfile1" rm -f "$tmpfile2" runisql <"$tmpfile2" cp "$tmpfile2" "$OPDIRCSVFILE" rm -f "$tmpfile1" rm -f "$tmpfile2" ############################### # remove lock #rm -f $LOCKFILE ############################### exit 0