I need the number of total files in a directory and want to use this number in a shell script. I tried this in terminal and it works fine:
find . -type f | wc -l
It just prints the number of files, but I want to assign the returned number to a variable in my shell script, I tried this, but it doesn't work:
numberOfFiles = find . -type f | wc -l;
echo $numberOfFiles;