I have a directory that contains a lot of directories. I want to loop through each of the directories (inside the current directory) and do some processes only if the directory size is less than a specific value. I prepared a bash script, but I am not able to understand what is the error in it.
#!/bin/bash
SIZE=1933130072
for dir in */; do
CHECK="`du -shb "$dir" | cut -f1`"
if [$CHECK -lt $SIZE];then
echo "do rest of the steps"
fi
done