I trying to get a simple script to see if a directory contains any files in it. I am failing on the conditional IF statement. I am not sure if it because the command I am using is creating the variable as a string or if it is numeric or if I just have the syntax wrong.
#!/usr/bin/ksh
files=$(ls | wc -l)
echo $files
if [[$files -gt 0]];
then
print "There are files";
else
print "There are NO files";
fi
exit
Command Output:
1034
./test2.ksh[7]: [[: not found
There are NO files
Any assistance would be appreciated
Thank you