写法如下:

dir=${HOME}/test
if [ -d ${dir} -a "`ls -A ${dir}`" != "" ]; then
    echo "${dir} has files!"
fi

Logo

更多推荐