#!/bin/bash find *.txt | wc -l;
this gives the number of txt files. In my program, as I put this output in a variable, say "count"
#!/bin/bash count=$(find *.txt | wc -l)