I have a piece of code (below) in a .ksh script running on AIX. I need to convert the code to run .zsh on Solaris. Solaris's find command does not support the -cmin function. Suggestions??
The code searchs for a file (_filename) and determines if it has been written to or modified in the last 5 minutes. If it has, it goes to sleep for 5 minutes and then checks again.
LOOP=1
while [ ${LOOP} -eq 1 ]
do
find . -cmin -5 -name ${_filename} | read NEW_FILE
if [ ! -z ${NEW_FILE} ]
then
echo "INFO: preprocess_dc: Time index "`date`". The file ${_filename} is less than five minutes old."
echo "INFO: preprocess_dc: Waiting $vSleepTime seconds to verify the file is not still being written."
sleep $vSleepTime
else
LOOP=0
fi
done