find dirlocation -type d | while read dir; do
count=$(find "$dir" -type f | wc -l)
echo "$dir ; $count"
done
This script working fine on Linux environment but when I run this on Solaris then message is Variable syntax. Can anyone help me to sort out this problem please?
Your script is written in the bash shell dialect. It will run on Solaris, too, but only within a bash shell. If you choose a different shell under Linux, it will stop running there, either.