#/bin/bash

chmod -R a+rX /home/yjzhang/web/Cui/html_files/
cd /home/yjzhang/web/Cui/html_files/
nfile=`ls -1 *.html | wc -l`

if [ $nfile -gt 7 ]
then
    echo "There are more than 7 files"
    echo "Deleting the oldest file: $(ls -t *.html | tail -1)"
    rm "$(ls -t *.html | tail -1)"
else
    echo "No action needed"
fi
