Question : Shell status return value

Hi,
i have created a shell script (.ksh) the runs three queries(plsql). These three queries create three csv files which are saved in a directory called results. I need a way to check if these csv files have been created(if the proceeduree was a success or failure). I need a value of 0 or other to be returnd based on the success or failure of the proceedure. Ideally i would prefer somthing that could just be placed into my current script, without any manipulation(to existing shell script).

Thanks very much

Answer : Shell status return value

How is the name of the file generated?

I'm not exactly sure, but this may work.

if [ -s ${LOGDIR}/${SCRIPT}_${LOGDATE} ]
then
  echo "file exists and has data"
else
  echo "File does not exist or contains no data"
fi
Random Solutions  
 
programming4us programming4us