hi all
i want to count the number of files in a particlar dir i have wrote the codes as below
fileCount= ls | wc -l
if [ $fileCount -eq 0 ]
then
echo " "
elif [ $fileCount -gt 0 ]
then
echo " "
fi
however when i excute the program
there are error happens " unary operator expected"
i just woundering
fileCount= ls | wc -l
will ls | wc -l store into my variable fileCount?
thanks for helping