File size greater than 0

ok I want to know how to touch a file and find out that it is greater than 0 then if it is not I want to fail the job other wise I want to success amnd go on. Can anyone help.

Thanks
Shannon Kammer

You don't say which shell you are using. I'll go with ksh.

#! /usr/bin/ksh

FILE=/some/file

touch $FILE   # if FILE didn't exist, it does now

if [[ ! -s $FILE ]] ; then
          echo $FILE is empty
          exit 1
fi

#  FILE has some data, so we can continue...