Using bash, how can one get the number of files in a folder, excluding directories from a shell script without the interpreter complaining?
With the help of a friend
How about:
count=$(find .. -maxdepth 1 -type f|wc -l) echo $count let count=count+1 # Increase by one, for the next file number echo $count
Note that this solution is not efficient: it spawns sub shells for the find and wc commands, but it should work.
find
wc